From 0f7dfa3bd5f5118d398ba12ae001f679f7d96166 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 21 May 2010 11:15:20 +0000 Subject: [PATCH] could theoretically be NULL, check --- src/peerinfo/peerinfo_api.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index 7e9d9b2f0..5def415e9 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c @@ -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; -- 2.25.1