[Pkg-gnupg-commit] [gnupg2] 89/160: g10: Fix memory leak.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jul 15 09:36:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch upstream
in repository gnupg2.

commit 5fafd18d474da7b763f5b82c73b6ca4288e136d7
Author: Justus Winter <justus at g10code.com>
Date:   Fri Jul 1 11:26:54 2016 +0200

    g10: Fix memory leak.
    
    * g10/keygen.c (keygen_set_std_prefs): Fix memory leak.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 g10/keygen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/g10/keygen.c b/g10/keygen.c
index 11eb587..3a9a8e7 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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list