version 1.1.1.1.2.6, 2011/11/21 16:28:05
|
version 1.1.1.1.2.8, 2011/11/22 12:02:17
|
Line 244 mqtt_str2sub(const char **csStr, u_short strnum, u_cha
|
Line 244 mqtt_str2sub(const char **csStr, u_short strnum, u_cha
|
* mqtt_freeSub() Free array from subscribe variables |
* mqtt_freeSub() Free array from subscribe variables |
* |
* |
* @subs = Subscribe variables |
* @subs = Subscribe variables |
|
* @freeall = if !=0 free and subs pointer |
* return: none |
* return: none |
*/ |
*/ |
inline void |
inline void |
mqtt_freeSub(mqtt_subscr_t ** __restrict subs) | mqtt_freeSub(mqtt_subscr_t ** __restrict subs, int freeall) |
{ |
{ |
mqtt_subscr_t *v; |
mqtt_subscr_t *v; |
|
|
if (!subs) |
if (!subs) |
return; |
return; |
|
|
for (v = *subs; v; v++) | for (v = *subs; v->sub_data; v++) { |
free(v->sub_data); |
free(v->sub_data); |
free(*subs); | v->sub_data = NULL; |
*subs = NULL; | } |
| |
| if (freeall) { |
| free(*subs); |
| *subs = NULL; |
| } |
} |
} |