flush peer respect value on disconnect
[oweals/gnunet.git] / src / fs / fs_test_lib.c
index 1db777a7ac03efa02c13810eace14c9e28a32da3..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);
@@ -451,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;
@@ -630,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;