adding single location for no_forcestart configuration list
[oweals/gnunet.git] / src / fs / fs_test_lib.c
index 3898f798e0b6d395c9284d786d9a6e686191de21..1e098bd60e536bb389011d62a8e988a8dca1e84c 100644 (file)
@@ -196,7 +196,8 @@ report_uri (void *cls,
                    ? po->publish_tmp_file
                    : NULL);
   GNUNET_FS_uri_destroy (po->publish_uri);
-  if (GNUNET_YES != po->do_index)
+  if ( (GNUNET_YES != po->do_index) &&
+       (NULL != po->publish_tmp_file) )
     (void) GNUNET_DISK_directory_remove (po->publish_tmp_file);
   GNUNET_free_non_null (po->publish_tmp_file);
   GNUNET_free (po);
@@ -410,6 +411,7 @@ publish_fs_connect_complete_cb (void *cls,
                                                       po->publish_tmp_file,
                                                       NULL, NULL, po->do_index,
                                                       &bo);
+    GNUNET_assert (NULL != fi);
   }
   else
   {
@@ -418,6 +420,7 @@ publish_fs_connect_complete_cb (void *cls,
                                                        &file_generator, &po->publish_seed,
                                                        NULL, NULL,
                                                         po->do_index, &bo);
+    GNUNET_assert (NULL != fi);
   }
   po->publish_context =
     GNUNET_FS_publish_start (po->fs, fi, NULL, NULL, NULL,
@@ -449,7 +452,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer,
 {
   struct TestPublishOperation *po;
 
-  po = GNUNET_malloc (sizeof (struct TestPublishOperation));
+  po = GNUNET_new (struct TestPublishOperation);
   po->publish_cont = cont;
   po->publish_cont_cls = cont_cls;
   po->publish_seed = seed;
@@ -628,7 +631,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
 {
   struct TestDownloadOperation *dop;
 
-  dop = GNUNET_malloc (sizeof (struct TestDownloadOperation));
+  dop = GNUNET_new (struct TestDownloadOperation);
   dop->uri = GNUNET_FS_uri_dup (uri);
   dop->size = GNUNET_FS_uri_chk_get_file_size (uri);
   dop->verbose = verbose;