diff --git a/lib/nodes/mqtt.c b/lib/nodes/mqtt.c index d48681823..8c8d76795 100644 --- a/lib/nodes/mqtt.c +++ b/lib/nodes/mqtt.c @@ -82,12 +82,12 @@ static void mqtt_message_cb(struct mosquitto *mosq, void *userdata, const struct int ret; struct node *n = (struct node *) userdata; struct mqtt *m = (struct mqtt *) n->_vd; - struct sample *smps[n->in.vectorize]; + struct sample *smps[n->in.vectorize]; debug(5, "MQTT: Node %s received a message of %d bytes from broker %s", node_name(n), msg->payloadlen, m->host); - ret = sample_alloc_many(&m->pool, smps, n->in.vectorize); - if (ret<0) { + ret = sample_alloc_many(&m->pool, smps, n->in.vectorize); + if (ret <= 0) { warning("Pool underrun in subscriber of %s", node_name(n)); return; }