could theoretically be NULL, check
authorChristian Grothoff <christian@grothoff.org>
Fri, 21 May 2010 11:15:20 +0000 (11:15 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 21 May 2010 11:15:20 +0000 (11:15 +0000)
src/peerinfo/peerinfo_api.c

index 7e9d9b2f07383c55fdbf65effb603e660a887ef3..5def415e979748df16e3fff259a63aba4c922b3d 100644 (file)
@@ -232,14 +232,18 @@ do_transmit (void *cls, size_t size, void *buf)
                   ("Failed to transmit message of type %u to `%s' service.\n"),
                   ntohs (msg->type), "peerinfo");
 #endif
-      GNUNET_CONTAINER_DLL_remove (h->tq_head,
-                                  h->tq_tail,
-                                  tqe);
+      if (tqe != NULL)
+       GNUNET_CONTAINER_DLL_remove (h->tq_head,
+                                    h->tq_tail,
+                                    tqe);
       reconnect (h);
       trigger_transmit (h);
-      if (tqe->cont != NULL)
-       tqe->cont (tqe->cont_cls, GNUNET_SYSERR);
-      GNUNET_free (tqe);
+      if (tqe != NULL)
+       {
+         if (tqe->cont != NULL)
+           tqe->cont (tqe->cont_cls, GNUNET_SYSERR);
+         GNUNET_free (tqe);
+       }
       return 0;
     }
   ret = tqe->size;