if (payload == NULL)
{
ERROR ("mqtt plugin: malloc for payload buffer failed.");
+ sfree (vl.values);
return;
}
memmove (payload, msg->payload, msg->payloadlen);
ERROR ("mqtt plugin: Unknown config option: %s", child->key);
}
- tmp = realloc (subscribers, sizeof (*subscribers) * subscribers_num);
+ tmp = realloc (subscribers, sizeof (*subscribers) * (subscribers_num + 1) );
if (tmp == NULL)
{
ERROR ("mqtt plugin: realloc failed.");