diff --git a/src/mqtt.c b/src/mqtt.c
index 7003fcc63e19b08d775d1c258e058383c3061389..8bc412c9497213074a738ca7dfa355209c1872d1 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
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.");