diff --git a/src/apps/mqtt/mqtt.c b/src/apps/mqtt/mqtt.c index 1adcab0b..de6327d4 100644 --- a/src/apps/mqtt/mqtt.c +++ b/src/apps/mqtt/mqtt.c @@ -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 diff --git a/src/include/lwip/apps/mqtt.h b/src/include/lwip/apps/mqtt.h index 0007e40b..c4f1a6dd 100644 --- a/src/include/lwip/apps/mqtt.h +++ b/src/include/lwip/apps/mqtt.h @@ -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);