From f7a801c7347c9dae30658c1b7b0eda0a62e2fd47 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 27 May 2011 13:31:12 +0000 Subject: [PATCH] docu, check NULL --- src/datastore/datastore_api.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 76d9e5f3c..d861157d9 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -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)); } -- 2.25.1