Skip to content

Commit 02d2e5c

Browse files
fix(msc): fopen Werror=use-after-free
1 parent ca514b8 commit 02d2e5c

File tree

1 file changed

+2
-1
lines changed
  • host/class/msc/usb_host_msc/test_app/main

1 file changed

+2
-1
lines changed

host/class/msc/usb_host_msc/test_app/main/test_msc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ static void write_read_file(const char *file_path)
160160
fclose(f);
161161

162162
ESP_LOGI(TAG, "Reading file");
163-
TEST_ASSERT(fopen(file_path, "r"));
163+
f = fopen(file_path, "r");
164+
TEST_ASSERT(f);
164165
fgets(line, sizeof(line), f);
165166
fclose(f);
166167
// strip newline

0 commit comments

Comments
 (0)