mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
mqtt: fix memory corruption in MQTT node (closes #237)
This commit is contained in:
parent
40f91ad46a
commit
e4de0aad1c
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue