gpg: Fix double free.
authorNeal H. Walfield <neal@g10code.com>
Mon, 4 Jan 2016 11:46:11 +0000 (12:46 +0100)
committerNeal H. Walfield <neal@g10code.com>
Mon, 4 Jan 2016 11:46:11 +0000 (12:46 +0100)
* g10/getkey.c (get_pubkeys): Fix double free.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Fixes-commit: 7195b943

Note: this error is not a security problem, because this code path is
currently never executed.

g10/getkey.c

index 52e3d23..86a3c80 100644 (file)
@@ -629,15 +629,7 @@ get_pubkeys (ctrl_t ctrl,
 
  out:
   if (err)
-    {
-      while ((r = results))
-        {
-          results = results->next;
-          pubkey_free (r);
-          release_kbnode (r->keyblock);
-          xfree (r);
-        }
-    }
+    pubkeys_free (results);
   else
     *r_keys = results;