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 committed 2020-02-10 08:01:10 +01:00
1 parent 7983357489
commit 3e4f91ae50
1 file changed
+1
+1
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;
}