docu, check NULL
authorChristian Grothoff <christian@grothoff.org>
Fri, 27 May 2011 13:31:12 +0000 (13:31 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 27 May 2011 13:31:12 +0000 (13:31 +0000)
src/datastore/datastore_api.c

index 76d9e5f3c8363d4fe804863c61105c8a02fdfd83..d861157d9b048fb29e1c20b15aa4d67e09596ac7 100644 (file)
@@ -692,6 +692,13 @@ drop_status_cont (void *cls, int32_t result, const char *emsg)
 }
 
 
+/**
+ * Free a queue entry.  Removes the given entry from the
+ * queue and releases associated resources.  Does NOT
+ * call the callback.
+ * 
+ * @param qe entry to free.
+ */
 static void
 free_queue_entry (struct GNUNET_DATASTORE_QueueEntry *qe)
 {
@@ -710,6 +717,7 @@ free_queue_entry (struct GNUNET_DATASTORE_QueueEntry *qe)
   GNUNET_free (qe);
 }
 
+
 /**
  * Type of a function to call when we receive a message
  * from the service.
@@ -1281,15 +1289,16 @@ process_result_message (void *cls,
 #endif
   free_queue_entry (qe);
   h->retry_time.rel_value = 0;
-  rc.proc (rc.proc_cls,
-          &dm->key,
-          ntohl(dm->size),
-          &dm[1],
-          ntohl(dm->type),
-          ntohl(dm->priority),
-          ntohl(dm->anonymity),
-          GNUNET_TIME_absolute_ntoh(dm->expiration),   
-          GNUNET_ntohll(dm->uid));
+  if (rc.proc != NULL)
+    rc.proc (rc.proc_cls,
+            &dm->key,
+            ntohl(dm->size),
+            &dm[1],
+            ntohl(dm->type),
+            ntohl(dm->priority),
+            ntohl(dm->anonymity),
+            GNUNET_TIME_absolute_ntoh(dm->expiration), 
+            GNUNET_ntohll(dm->uid));
 }