Client: unlock if subscribe message fails to be created

Closes https://github.com/espressif/esp-mqtt/issues/150
This commit is contained in:
Umer Ilyas
2020-02-06 19:37:47 +05:00
committed by David Cermak
parent d5e915296e
commit 7983357489

View File

@@ -1460,6 +1460,7 @@ int esp_mqtt_client_subscribe(esp_mqtt_client_handle_t client, const char *topic
&client->mqtt_state.pending_msg_id);
if (client->mqtt_state.outbound_message->length == 0) {
ESP_LOGE(TAG, "Subscribe message cannot be created");
MQTT_API_UNLOCK(client);
return -1;
}