fix error handling, do not continue with uninitialized variable after failure
authorChristian Grothoff <christian@grothoff.org>
Fri, 5 Jan 2018 16:18:06 +0000 (17:18 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 5 Jan 2018 16:18:06 +0000 (17:18 +0100)
src/peerinfo/gnunet-service-peerinfo.c

index af1eb2d1d6e6566716d559b11676a13f989fbb7f..83a7b589bf2bd0515993e98dec9712c592435992 100644 (file)
@@ -559,11 +559,11 @@ hosts_directory_scan_callback (void *cls,
     if (GNUNET_OK !=
         GNUNET_HELLO_get_id (r.friend_only_hello,
                              &id_friend))
+    {
       if (GNUNET_YES == dsc->remove_files)
-      {
        remove_garbage (fullname);
-       return GNUNET_OK;
-      }
+      return GNUNET_OK;
+    }
     id = id_friend;
   }
   if (NULL != r.hello)
@@ -571,11 +571,11 @@ hosts_directory_scan_callback (void *cls,
     if (GNUNET_OK !=
         GNUNET_HELLO_get_id (r.hello,
                              &id_public))
+    {
       if (GNUNET_YES == dsc->remove_files)
-      {
        remove_garbage (fullname);
-       return GNUNET_OK;
-      }
+      return GNUNET_OK;
+    }
     id = id_public;
   }