Merge branch 'bugfix/missed_mutex_unlock' into 'master'

Fixed missing mutex unlock if subscribe message fails to be created

See merge request espressif/esp-mqtt!58
This commit is contained in:
David Čermák
2020-02-10 15:43:27 +08:00
2 changed files with 3 additions and 1 deletions

View File

@@ -93,7 +93,7 @@ build_and_test_qemu:
script:
- cit_add_ssh_key "${GITLAB_KEY}"
- git clone "${IDF_REPO}"
- $MQTT_PATH/ci/set_idf.sh master
- $MQTT_PATH/ci/set_idf.sh release/v4.1
- cd $IDF_PATH && tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)"
- $MQTT_PATH/ci/set_mqtt.sh $CI_COMMIT_SHA
# build publish stress test

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;
}
@@ -1491,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;
}