Fix bug #51681: mqtt: cannot free client

Add free function
This commit is contained in:
Dirk Ziegelmeier 2017-08-07 20:43:25 +02:00
parent 4fb7fab850
commit 42fd01547d
2 changed files with 11 additions and 1 deletions

View File

@ -1214,6 +1214,16 @@ mqtt_client_new(void)
return (mqtt_client_t *)mem_calloc(1, sizeof(mqtt_client_t));
}
/**
* @ingroup mqtt
* Free MQTT client instance
* @param client Pointer to instance to be freed
*/
void
mqtt_client_free(mqtt_client_t* client)
{
mem_free(client);
}
/**
* @ingroup mqtt

View File

@ -179,8 +179,8 @@ err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t
/** Disconnect from server */
void mqtt_disconnect(mqtt_client_t *client);
/** Create new client */
mqtt_client_t *mqtt_client_new(void);
void mqtt_client_free(mqtt_client_t* client);
/** Check connection status */
u8_t mqtt_client_is_connected(mqtt_client_t *client);