Client: unlock if unsubscribe message fails to be created

In a similar way as for the subscribe message
This commit is contained in:
David Cermak
2020-02-10 07:58:36 +01:00
parent 7983357489
commit 3e4f91ae50

View File

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