Kaynağa Gözat

check if file_json_data is allocated

jblanked 9 ay önce
ebeveyn
işleme
06fee44cfc
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  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;
     }