Przeglądaj źródła

FlipWiFi: Fix freeze when configs don't exist

Willy-JL 1 rok temu
rodzic
commit
826fdbda71
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      flip_wifi/flip_wifi_storage.h

+ 1 - 1
flip_wifi/flip_wifi_storage.h

@@ -265,12 +265,12 @@ void save_settings(const char* ssid, const char* password) {
             }
             }
 
 
             storage_file_close(file);
             storage_file_close(file);
-            storage_file_free(file);
         } else {
         } else {
             // If the file doesn't exist, initialize an empty buffer
             // If the file doesn't exist, initialize an empty buffer
             file_size = 0;
             file_size = 0;
             buffer = NULL;
             buffer = NULL;
         }
         }
+        storage_file_free(file);
 
 
         // Prepare new SSID and Password
         // Prepare new SSID and Password
         size_t new_ssid_length = strlen(ssid) + 1; // Including null terminator
         size_t new_ssid_length = strlen(ssid) + 1; // Including null terminator