agent: Fix possible uninitalized use of CTX in simple_pwquery.
authorWerner Koch <wk@gnupg.org>
Wed, 24 Oct 2018 18:22:17 +0000 (20:22 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 24 Oct 2018 18:22:17 +0000 (20:22 +0200)
* common/simple-pwquery.c (agent_open): Clear CTX even on early error.
--

GnuPG-bug-id: 4223
Signed-off-by: Werner Koch <wk@gnupg.org>
common/simple-pwquery.c

index e7f4af3..b8ada42 100644 (file)
@@ -246,6 +246,7 @@ agent_open (assuan_context_t *ctx)
 #ifdef SPWQ_USE_LOGGING
       log_error (_("no gpg-agent running in this session\n"));
 #endif
+      *ctx = NULL;
       return SPWQ_NO_AGENT;
     }