summaryrefslogtreecommitdiffstats
path: root/common/t-name-value.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-name-value.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-name-value.c')
-rw-r--r--common/t-name-value.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/t-name-value.c b/common/t-name-value.c
index fc9303bb8..3b01431d4 100644
--- a/common/t-name-value.c
+++ b/common/t-name-value.c
@@ -387,19 +387,19 @@ run_modification_tests (void)
if (private_key_mode)
{
err = nvc_set_private_key (pk, key);
- gcry_sexp_release (key);
assert (err == 0);
buf = nvc_to_string (pk);
assert (strcmp (buf, "Key: (hello world)\n") == 0);
xfree (buf);
- nvc_release (pk);
}
else
{
err = nvc_set_private_key (pk, key);
assert (gpg_err_code (err) == GPG_ERR_MISSING_KEY);
}
+ gcry_sexp_release (key);
+ nvc_release (pk);
}