agent: Fix possible release of unitialize var in a genkey error case.
authorWerner Koch <wk@gnupg.org>
Wed, 24 Oct 2018 18:16:26 +0000 (20:16 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 24 Oct 2018 18:16:26 +0000 (20:16 +0200)
* agent/command.c (cmd_genkey): Initialize 'value'.
--

GnuPG-bug-id: 4222
Signed-off-by: Werner Koch <wk@gnupg.org>
agent/command.c

index 0871753..7fbf1de 100644 (file)
@@ -887,7 +887,7 @@ cmd_genkey (assuan_context_t ctx, char *line)
   ctrl_t ctrl = assuan_get_pointer (ctx);
   int rc;
   int no_protection;
   ctrl_t ctrl = assuan_get_pointer (ctx);
   int rc;
   int no_protection;
-  unsigned char *value;
+  unsigned char *value = NULL;
   size_t valuelen;
   unsigned char *newpasswd = NULL;
   membuf_t outbuf;
   size_t valuelen;
   unsigned char *newpasswd = NULL;
   membuf_t outbuf;