-do not call uri_to_string with NULL pointer
authorChristian Grothoff <christian@grothoff.org>
Fri, 9 Mar 2012 20:57:28 +0000 (20:57 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 9 Mar 2012 20:57:28 +0000 (20:57 +0000)
src/fs/fs_api.c

index 29539a498b78d529b926895e1448405c9aab6664..9acec5be45c7d2d729eab7f3e928f557177d7028 100644 (file)
@@ -1539,7 +1539,10 @@ GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc)
     GNUNET_break (0);
     goto cleanup;
   }
-  uris = GNUNET_FS_uri_to_string (uc->ksk_uri);
+  if (NULL != uc->ksk_uri)
+    uris = GNUNET_FS_uri_to_string (uc->ksk_uri);
+  else
+    uris = NULL;
   if ((GNUNET_OK != GNUNET_BIO_write_string (wh, uc->filename)) ||
       (GNUNET_OK != GNUNET_BIO_write_int64 (wh, uc->file_size)) ||
       (GNUNET_OK != write_start_time (wh, uc->start_time)) ||