Don't segfault if the first 'auto-key-locate' option is 'clear'.
authorNeal H. Walfield <neal@g10code.com>
Thu, 16 Jul 2015 07:57:27 +0000 (09:57 +0200)
committerNeal H. Walfield <neal@gnu.org>
Thu, 16 Jul 2015 09:36:31 +0000 (11:36 +0200)
* g10/getkey.c (free_akl): If AKL is NULL, just return.

--
Backported from f2ee673c99825d5189631031ddec2dbf54dbd482.  Note:
unlike in 2.1, in 2.0 this bug is not (currently) triggered since
parse_auto_key_locate doesn't recognize "clear".

Signed-off-by: Neal H. Walfield <neal@g10code.com>.
Reported-by: Sami Farin.
GnuPG-bug-id: 2045

g10/getkey.c

index a27c8e2..6c14683 100644 (file)
@@ -3098,6 +3098,9 @@ get_ctx_handle(GETKEY_CTX ctx)
 static void
 free_akl(struct akl *akl)
 {
+  if (! akl)
+    return;
+
   if(akl->spec)
     free_keyserver_spec(akl->spec);