From: Matthias Wachs Date: Thu, 15 Mar 2012 18:22:00 +0000 (+0000) Subject: fix segfault X-Git-Tag: initial-import-from-subversion-38251~14224 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8e125c6490ec13ce6b579d0b078d36b1c155ab82;p=oweals%2Fgnunet.git fix segfault --- diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index bfdae2603..dcf1075b6 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -304,13 +304,14 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client) if ((NULL == client) || (NULL == nc)) return; - for (no = nc->op_head; no != NULL; no = no->next) + no = nc->op_head; + while (NULL != no) { GNUNET_CONTAINER_DLL_remove (nc->op_head, nc->op_tail, no); GNUNET_free (no); + no = nc->op_head; } - GNUNET_SERVER_client_drop(nc->client); GNUNET_CONTAINER_DLL_remove (client_head, client_tail, nc); GNUNET_free (nc);