init
authorChristian Grothoff <christian@grothoff.org>
Fri, 12 Mar 2010 14:35:37 +0000 (14:35 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 12 Mar 2010 14:35:37 +0000 (14:35 +0000)
src/fs/gnunet-publish.c

index db4ea978e524de7298bc4afc84d82269dabdd30c..860a81522d3d6e317d80e36130e3298f1b57f157 100644 (file)
@@ -441,19 +441,24 @@ run (void *cls,
     }
   emsg = NULL;
   if (0 != STAT (args[0], &sbuf))
-    GNUNET_asprintf (&emsg,
-                    _("Could not access file: %s\n"),
-                    STRERROR (errno));
+    {
+      GNUNET_asprintf (&emsg,
+                      _("Could not access file: %s\n"),
+                      STRERROR (errno));
+      fi = NULL;
+    }
   else if (S_ISDIR (sbuf.st_mode))
-    fi = GNUNET_FS_file_information_create_from_directory (NULL,
-                                                          args[0],
-                                                          &GNUNET_FS_directory_scanner_default,
-                                                          l,
-                                                          !do_insert,
-                                                          anonymity,
-                                                          priority,
-                                                          GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION),
-                                                          &emsg);
+    {
+      fi = GNUNET_FS_file_information_create_from_directory (NULL,
+                                                            args[0],
+                                                            &GNUNET_FS_directory_scanner_default,
+                                                            l,
+                                                            !do_insert,
+                                                            anonymity,
+                                                            priority,
+                                                            GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION),
+                                                            &emsg);
+    }
   else
     {
       fi = GNUNET_FS_file_information_create_from_file (NULL,