g13: Fix releasing of a syshelp context.
authorWerner Koch <wk@gnupg.org>
Mon, 14 Dec 2015 09:42:27 +0000 (10:42 +0100)
committerWerner Koch <wk@gnupg.org>
Sat, 13 Feb 2016 16:06:39 +0000 (17:06 +0100)
* g13/call-syshelp.c (call_syshelp_release): Allow a NULL arg.

Signed-off-by: Werner Koch <wk@gnupg.org>
g13/call-syshelp.c

index 2086dd1..545bc1a 100644 (file)
@@ -119,6 +119,11 @@ start_syshelp (ctrl_t ctrl)
 void
 call_syshelp_release (ctrl_t ctrl)
 {
-  assuan_release (ctrl->syshelp_local->assctx);
-  ctrl->syshelp_local->assctx = NULL;
+  if (!ctrl)
+    return;
+  if (ctrl->syshelp_local)
+    {
+      assuan_release (ctrl->syshelp_local->assctx);
+      ctrl->syshelp_local->assctx = NULL;
+    }
 }