mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(newlib): fix GCC 14 analyzer warnings
This commit is contained in:
parent
5e4d6190d8
commit
06fdb02435
@ -34,6 +34,8 @@ int scandir(const char *dirname, struct dirent ***out_dirlist,
|
|||||||
dir_ptr = opendir(dirname);
|
dir_ptr = opendir(dirname);
|
||||||
ESP_GOTO_ON_FALSE(dir_ptr, -1, out, TAG, "Failed to open directory: %s", dirname);
|
ESP_GOTO_ON_FALSE(dir_ptr, -1, out, TAG, "Failed to open directory: %s", dirname);
|
||||||
|
|
||||||
|
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak") // Ignore intended return of allocated *out_dirlist
|
||||||
|
|
||||||
while ((entry = readdir(dir_ptr)) != NULL) {
|
while ((entry = readdir(dir_ptr)) != NULL) {
|
||||||
/* skip entries that don't match the filter function */
|
/* skip entries that don't match the filter function */
|
||||||
if (select_func != NULL && !select_func(entry)) {
|
if (select_func != NULL && !select_func(entry)) {
|
||||||
@ -72,7 +74,6 @@ out:
|
|||||||
free(entries);
|
free(entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak") // Ignore intended return of allocated *out_dirlist
|
|
||||||
if (dir_ptr) {
|
if (dir_ptr) {
|
||||||
closedir(dir_ptr);
|
closedir(dir_ptr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user