fix NULL memory access
authorSree Harsha Totakura <totakura@in.tum.de>
Fri, 20 Jul 2012 15:03:54 +0000 (15:03 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Fri, 20 Jul 2012 15:03:54 +0000 (15:03 +0000)
src/testbed/gnunet-service-testbed.c

index 5cc9482b4555ad0399858ad944c1c0275baadd28..a80b63c0edb3cf512a7f2a61430c31e1feeb996f 100644 (file)
@@ -1481,10 +1481,12 @@ shutdown_task (void *cls,
       if (NULL != slave_list[id]->controller_proc)
         GNUNET_TESTBED_controller_stop (slave_list[id]->controller_proc);
     }
-  GNUNET_free_non_null (master_context->master_ip);
-  if (NULL != master_context->system)
-    GNUNET_TESTING_system_destroy (master_context->system, GNUNET_YES);
-  GNUNET_free_non_null (master_context);
+  if (NULL != master_context)
+  {  
+    GNUNET_free_non_null (master_context->master_ip);
+    if (NULL != master_context->system)
+      GNUNET_TESTING_system_destroy (master_context->system, GNUNET_YES);
+  }
 }