fix segfault
authorMatthias Wachs <wachs@net.in.tum.de>
Thu, 15 Mar 2012 18:22:00 +0000 (18:22 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Thu, 15 Mar 2012 18:22:00 +0000 (18:22 +0000)
src/namestore/gnunet-service-namestore.c

index bfdae2603804bbfaf650bdacdf6190016cc9bbbc..dcf1075b65fa7b9b871f75f1e6659747d66b06da 100644 (file)
@@ -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);