summaryrefslogtreecommitdiffstats
path: root/common/t-stringhelp.c
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2016-06-28 17:59:17 +0200
committerJustus Winter <justus@g10code.com>2016-06-28 18:21:50 +0200
commitc14ef10fc347d966a1efcb5c2000cbf3aaafa905 (patch)
treee36f40e1fe5672dcb1e38172559c0b431e1a9367 /common/t-stringhelp.c
parentdirmngr: add option to retrieve extra WKS info. (diff)
downloadgnupg2-c14ef10fc347d966a1efcb5c2000cbf3aaafa905.tar.xz
gnupg2-c14ef10fc347d966a1efcb5c2000cbf3aaafa905.zip
common: Fix memory leaks.
* common/ccparray.c (ccparray_put): Free old array. * common/stringhelp.c (do_make_filename): Free 'home'. * common/t-convert.c: Fix trivial memory leaks. * common/t-iobuf.c: Likewise. * common/t-mbox-util.c: Likewise. * common/t-name-value.c: Likewise. * common/t-stringhelp.c: Likewise. * common/t-strlist.c: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'common/t-stringhelp.c')
-rw-r--r--common/t-stringhelp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/t-stringhelp.c b/common/t-stringhelp.c
index 4f4555e14..ccadf0222 100644
--- a/common/t-stringhelp.c
+++ b/common/t-stringhelp.c
@@ -223,6 +223,7 @@ test_strconcat (void)
fail (0);
else if (errno != EINVAL)
fail (0);
+ xfree (out);
#if __GNUC__ < 4 /* gcc 4.0 has a sentinel attribute. */
out = strconcat (NULL);
@@ -232,6 +233,8 @@ test_strconcat (void)
out = strconcat (NULL, NULL);
if (!out || *out)
fail (1);
+ xfree (out);
+
out = strconcat ("", NULL);
if (!out || *out)
fail (1);
@@ -283,6 +286,7 @@ test_xstrconcat (void)
"1", "2", "3", "4", "5", "6", "7", NULL);
if (!out)
fail (0);
+ xfree (out);
#if __GNUC__ < 4 /* gcc 4.0 has a sentinel attribute. */
out = xstrconcat (NULL);
@@ -292,6 +296,8 @@ test_xstrconcat (void)
out = xstrconcat (NULL, NULL);
if (!out)
fail (1);
+ xfree (out);
+
out = xstrconcat ("", NULL);
if (!out || *out)
fail (1);
@@ -534,6 +540,7 @@ test_strsplit (void)
fail (tidx * 1000 + i + 1);
}
+ xfree (fields);
xfree (s2);
}
}