Sfoglia il codice sorgente

check if file_json_data is allocated

jblanked 9 mesi fa
parent
commit
06fee44cfc
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      game/storage.c

+ 4 - 0
game/storage.c

@@ -1105,6 +1105,10 @@ bool separate_world_data(char *id, FuriString *world_data)
     if (!file_json_data || furi_string_size(file_json_data) == 0)
     {
         FURI_LOG_E("Game", "Failed to get json data in separate_world_data");
+        if (file_json_data)
+        {
+            furi_string_free(file_json_data);
+        }
         return false;
     }