More fixes for #3522
[oweals/gnunet.git] / src / namestore / test_namestore_api_monitoring_existing.c
index 9051a8d89babcb6aecaf1565d38dd98c645c77b3..5d376a6340afd640623c65f86d7a99dceeed8457 100644 (file)
@@ -120,11 +120,6 @@ do_shutdown ()
     GNUNET_free (privkey2);
     privkey2 = NULL;
   }
-  if (NULL != directory)
-  {
-      GNUNET_DISK_directory_remove (directory);
-      GNUNET_free (directory);
-  }
 }
 
 
@@ -288,6 +283,7 @@ run (void *cls,
 
   directory = NULL;
   GNUNET_CONFIGURATION_get_value_string(mycfg, "PATHS", "GNUNET_TEST_HOME", &directory);
+  GNUNET_DISK_directory_remove (directory);
 
   res = 1;
 
@@ -355,7 +351,14 @@ main (int argc, char *argv[])
                                "test_namestore_api.conf",
                                &run,
                                NULL))
-    return 1;
+  {
+    res = 1;
+  }
+  if (NULL != directory)
+  {
+      GNUNET_DISK_directory_remove (directory);
+      GNUNET_free (directory);
+  }
   return res;
 }