mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-19 04:16:01 -04:00
fix(pthread): fix GCC 14 analyzer warnings
This commit is contained in:
parent
4d2881dac1
commit
5e4d6190d8
@ -163,6 +163,7 @@ esp_err_t esp_pthread_set_cfg(const esp_pthread_cfg_t *cfg)
|
||||
|
||||
/* If a value is already set, update that value */
|
||||
esp_pthread_cfg_t *p = pthread_getspecific(s_pthread_cfg_key);
|
||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak") // ignore leak of 'p'
|
||||
if (!p) {
|
||||
p = malloc(sizeof(esp_pthread_cfg_t));
|
||||
if (!p) {
|
||||
@ -173,7 +174,6 @@ esp_err_t esp_pthread_set_cfg(const esp_pthread_cfg_t *cfg)
|
||||
p->stack_alloc_caps = heap_caps;
|
||||
pthread_setspecific(s_pthread_cfg_key, p);
|
||||
|
||||
ESP_COMPILER_DIAGNOSTIC_PUSH_IGNORE("-Wanalyzer-malloc-leak") // ignore leak of 'p'
|
||||
return 0;
|
||||
ESP_COMPILER_DIAGNOSTIC_POP("-Wanalyzer-malloc-leak")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user