From 5fafd18d474da7b763f5b82c73b6ca4288e136d7 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 1 Jul 2016 11:26:54 +0200 Subject: [PATCH] g10: Fix memory leak. * g10/keygen.c (keygen_set_std_prefs): Fix memory leak. Signed-off-by: Justus Winter --- g10/keygen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/g10/keygen.c b/g10/keygen.c index 11eb587c0..3a9a8e7cb 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -413,9 +413,9 @@ keygen_set_std_prefs (const char *string,int personal) if(strlen(string)) { - char *tok,*prefstring; + char *dup, *tok, *prefstring; - prefstring=xstrdup(string); /* need a writable string! */ + dup = prefstring = xstrdup (string); /* need a writable string! */ while((tok=strsep(&prefstring," ,"))) { @@ -449,7 +449,7 @@ keygen_set_std_prefs (const char *string,int personal) } } - xfree(prefstring); + xfree (dup); } if(!rc)