forked from espressif/esp-mqtt
Fix potential memory leak if failing to create mutex
Closes https://github.com/espressif/esp-idf/issues/4384 Closes IDFGH-2235
This commit is contained in:
committed by
David Cermak
parent
9655845fdc
commit
9ca997d2d4
@ -412,6 +412,7 @@ esp_mqtt_client_handle_t esp_mqtt_client_init(const esp_mqtt_client_config_t *co
|
||||
}
|
||||
client->api_lock = xSemaphoreCreateMutex();
|
||||
if (!client->api_lock) {
|
||||
free(client->event.error_handle);
|
||||
free(client);
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user