aboutsummaryrefslogtreecommitdiffstats
path: root/common/stringhelp.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-06-28 15:59:17 +0000
committerJustus Winter <[email protected]>2016-06-28 16:21:50 +0000
commitc14ef10fc347d966a1efcb5c2000cbf3aaafa905 (patch)
treee36f40e1fe5672dcb1e38172559c0b431e1a9367 /common/stringhelp.c
parentdirmngr: add option to retrieve extra WKS info. (diff)
downloadgnupg-c14ef10fc347d966a1efcb5c2000cbf3aaafa905.tar.gz
gnupg-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 <[email protected]>
Diffstat (limited to 'common/stringhelp.c')
-rw-r--r--common/stringhelp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/stringhelp.c b/common/stringhelp.c
index 0e96c9e54..95912e0b2 100644
--- a/common/stringhelp.c
+++ b/common/stringhelp.c
@@ -538,6 +538,7 @@ do_make_filename (int xmode, const char *first_part, va_list arg_ptr)
home_buffer = xtrymalloc (n);
if (!home_buffer)
{
+ xfree (home);
xfree (name);
return NULL;
}
@@ -556,6 +557,7 @@ do_make_filename (int xmode, const char *first_part, va_list arg_ptr)
else
strcpy (stpcpy (stpcpy (p, home), "/"), name);
+ xfree (home);
xfree (name);
name = home_buffer;
/* Let's do a simple compression to catch the most common