Skip to content

Commit

Permalink
Merge pull request #301 from embhorn/zd14434
Browse files Browse the repository at this point in the history
Fix to release connect ack props
  • Loading branch information
dgarske authored Jul 25, 2022
2 parents 9d43e6a + 224c173 commit c02e2b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ static int Handle_Props(MqttClient* client, MqttProp* props, byte use_cb,
* \param ppacket_type Decoded packet type
* \param ppacket_qos Decoded QoS level
* \param ppacket_id Decoded packet id
* \param doProps True: Call Handle_Props to free prop struct
* \return Returns length decoded or error (as negative) MQTT_CODE_ERROR_*
(see enum MqttPacketResponseCodes)
Expand Down Expand Up @@ -987,7 +988,7 @@ static int MqttClient_WaitType(MqttClient *client, void *packet_obj,
/* Decode Packet - get type, qos and id */
rc = MqttClient_DecodePacket(client, client->rx_buf,
client->packet.buf_len, NULL, &packet_type, &packet_qos,
&packet_id, 0);
&packet_id, 1);
if (rc < 0) {
break;
}
Expand Down
4 changes: 4 additions & 0 deletions src/mqtt_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,10 @@ MqttProp* MqttProps_Add(MqttProp **head)
prev->next = new_prop;
}
}
else {
/* Could not allocate property */
(void)MQTT_TRACE_ERROR(MQTT_CODE_ERROR_PROPERTY);
}

#ifdef WOLFMQTT_MULTITHREAD
(void)wm_SemUnlock(&clientPropStack_lock);
Expand Down

0 comments on commit c02e2b7

Please sign in to comment.