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 authored and David Cermak committed 2020-02-10 08:00:45 +01:00
1 parent d5e915296e
commit 7983357489
1 file changed
+1
+1
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;
}