-allow NULL
authorChristian Grothoff <christian@grothoff.org>
Thu, 26 Jan 2012 22:50:42 +0000 (22:50 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 26 Jan 2012 22:50:42 +0000 (22:50 +0000)
src/util/helper.c

index c7e05923760be1897d0c13f1afa3904f9fb644fb..029203638563103ce9e4321e884931c63f02fe3e 100644 (file)
@@ -189,7 +189,8 @@ stop_helper (struct GNUNET_HELPER_Handle *h)
     GNUNET_CONTAINER_DLL_remove (h->mq_head,
                                 h->mq_tail,
                                 qe);
-    qe->cont (qe->cont_cls, GNUNET_NO);
+    if (NULL != qe->cont)
+      qe->cont (qe->cont_cls, GNUNET_NO);
     GNUNET_free (qe);
   }
   /* purge MST buffer */
@@ -387,7 +388,8 @@ GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h)
     GNUNET_CONTAINER_DLL_remove (h->mq_head,
                                 h->mq_tail,
                                 qe);
-    qe->cont (qe->cont_cls, GNUNET_SYSERR);
+    if (NULL != qe->cont)
+      qe->cont (qe->cont_cls, GNUNET_SYSERR);
     GNUNET_free (qe);
   }
   stop_helper (h);