Skip to content

Commit 887fad4

Browse files
committed
release socket resources when the request to establish a session with the mqtt server fails ...
1 parent 6c89724 commit 887fad4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mqttclient/mqttclient.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: jiejie
33
* @Github: https://github.com/jiejieTop
44
* @Date: 2019-12-09 21:31:25
5-
* @LastEditTime: 2020-10-29 14:15:15
5+
* @LastEditTime: 2020-11-05 16:02:47
66
* @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
77
*/
88
#include "mqttclient.h"
@@ -1045,6 +1045,7 @@ static int mqtt_connect_with_results(mqtt_client_t* c)
10451045
c->mqtt_ping_outstanding = 0; /* reset ping outstanding */
10461046

10471047
} else {
1048+
network_release(c->mqtt_network);
10481049
mqtt_set_client_state(c, CLIENT_STATE_INITIALIZED); /* connect failed */
10491050
}
10501051

0 commit comments

Comments
 (0)