fix
authorChristian Grothoff <christian@grothoff.org>
Mon, 5 Mar 2012 21:04:31 +0000 (21:04 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 5 Mar 2012 21:04:31 +0000 (21:04 +0000)
src/statistics/gnunet-service-statistics.c

index 544bf6a433f249613095f35e414dd782b10190fd..27102f07033b744e2b730560bebc213818564a6a 100644 (file)
@@ -682,13 +682,13 @@ do_shutdown ()
 {
   struct WatchEntry *we;
   struct StatsEntry *se;
+  struct GNUNET_SERVER_Handle *s;
 
+  if (NULL == nc)
+    return;
   save ();
-  if (NULL != nc)
-  {
-    GNUNET_SERVER_notification_context_destroy (nc);
-    nc = NULL;
-  }
+  GNUNET_SERVER_notification_context_destroy (nc);
+  nc = NULL;  
   GNUNET_assert (NULL == client_head);
   while (NULL != (se = start))
   {
@@ -701,7 +701,10 @@ do_shutdown ()
     }
     GNUNET_free (se);
   }
-  GNUNET_SERVER_destroy (srv);
+  GNUNET_assert (NULL != srv);
+  s = srv;
+  srv = NULL;
+  GNUNET_SERVER_destroy (s);
 }