--- libaitmqtt/src/aitmqtt.c 2022/09/13 20:16:43 1.3.4.2 +++ libaitmqtt/src/aitmqtt.c 2022/09/13 22:20:59 1.3.4.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitmqtt.c,v 1.3.4.2 2022/09/13 20:16:43 misho Exp $ +* $Id: aitmqtt.c,v 1.3.4.3 2022/09/13 22:20:59 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -107,18 +107,18 @@ _mqtt_readHEADER(mqtt_msg_t * __restrict buf, u_char c * mqtt_msgFree() Free MQTT message * * @msg = Message buffer - * @all = !=0 Destroy entire message, if MQTT Message allocated with mqtt_msgAlloc() + * @keepmsg = !=0 just free message content * return: none */ void -mqtt_msgFree(mqtt_msg_t ** __restrict msg, int all) +mqtt_msgFree(mqtt_msg_t ** __restrict msg, int keepmsg) { if (msg && *msg) { if ((*msg)->msg_base) { free((*msg)->msg_base); (*msg)->msg_base = NULL; } - if (all) { + if (!keepmsg) { free(*msg); *msg = NULL; } else