aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-07-13 13:11:46 +0000
committerWerner Koch <[email protected]>2016-07-13 13:11:46 +0000
commit4ef62278e3c9406360dc50288f422291497e218f (patch)
treefff3a49be5c2659ab87195e5b0a4f88e51a49205 /common/t-iobuf.c
parentMerge branch 'master' into STABLE-BRANCH-2-2 (diff)
parentgpg: New option --mimemode. (diff)
downloadgnupg-4ef62278e3c9406360dc50288f422291497e218f.tar.gz
gnupg-4ef62278e3c9406360dc50288f422291497e218f.zip
Merge branch 'master' into STABLE-BRANCH-2-2
--
Diffstat (limited to '')
-rw-r--r--common/t-iobuf.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/common/t-iobuf.c b/common/t-iobuf.c
index 2835df4d2..0e6f508a5 100644
--- a/common/t-iobuf.c
+++ b/common/t-iobuf.c
@@ -190,6 +190,8 @@ main (int argc, char *argv[])
n ++;
}
assert (n == 10 + (strlen (content) - 10) / 2);
+
+ iobuf_close (iobuf);
}
@@ -266,6 +268,8 @@ main (int argc, char *argv[])
/* The string should have been truncated (max_len == 0). */
assert (max_len == 0);
free (buffer);
+
+ iobuf_close (iobuf);
}
{
@@ -279,10 +283,12 @@ main (int argc, char *argv[])
int c;
int n;
int lastc = 0;
+ struct content_filter_state *state;
iobuf = iobuf_temp_with_content (content, strlen(content));
rc = iobuf_push_filter (iobuf,
- content_filter, content_filter_new (content2));
+ content_filter,
+ state=content_filter_new (content2));
assert (rc == 0);
n = 0;
@@ -309,6 +315,9 @@ main (int argc, char *argv[])
/* printf ("%d: '%c' (%d)\n", n, c, c); */
}
}
+
+ iobuf_close (iobuf);
+ free (state);
}
/* Write some data to a temporary filter. Push a new filter. The
@@ -346,6 +355,8 @@ main (int argc, char *argv[])
assert (n == strlen (content) + 2 * (strlen (content2) + 1));
assert (strcmp (buffer, "0123456789aabbcc") == 0);
+
+ iobuf_close (iobuf);
}
{
@@ -373,6 +384,8 @@ main (int argc, char *argv[])
assert (n == 2);
assert (buffer[0] == '3');
assert (buffer[1] == '7');
+
+ iobuf_close (iobuf);
}
return 0;