ソースを参照

FlipWiFi: Fix freeze when configs don't exist

Willy-JL 1 年間 前
コミット
826fdbda71
1 ファイル変更1 行追加1 行削除
  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_free(file);
         } else {
             // If the file doesn't exist, initialize an empty buffer
             file_size = 0;
             buffer = NULL;
         }
+        storage_file_free(file);
 
         // Prepare new SSID and Password
         size_t new_ssid_length = strlen(ssid) + 1; // Including null terminator