summaryrefslogtreecommitdiffstats
path: root/common/name-value.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2021-04-12 19:29:21 +0200
committerWerner Koch <wk@gnupg.org>2021-05-20 14:31:23 +0200
commit4704d1ce4e1e2ba9f986fb221346eda5c97f947b (patch)
tree2e2e9b343b992b27769a2a10031126a166433e4c /common/name-value.c
parentagent: Fix memory leaks (diff)
downloadgnupg2-4704d1ce4e1e2ba9f986fb221346eda5c97f947b.tar.xz
gnupg2-4704d1ce4e1e2ba9f986fb221346eda5c97f947b.zip
common: Avoid double-free
* common/name-value.c (do_nvc_parse): reset to null after ownership change -- Signed-off-by: Jakub Jelen <jjelen@redhat.com> GnuPG-bug-id: 5393
Diffstat (limited to 'common/name-value.c')
-rw-r--r--common/name-value.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/name-value.c b/common/name-value.c
index 0bd205b7d..39c3244e9 100644
--- a/common/name-value.c
+++ b/common/name-value.c
@@ -724,6 +724,7 @@ do_nvc_parse (nvc_t *result, int *errlinep, estream_t stream,
if (raw_value)
{
err = _nvc_add (*result, name, NULL, raw_value, 1);
+ name = NULL;
if (err)
goto leave;
}