1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Make sure buffers are nulled to ensure cleanup.

This commit is contained in:
Dave C-J 2014-06-17 20:06:54 +01:00
parent c61d4d3209
commit 6f6ecfc7a8
2 changed files with 4 additions and 0 deletions

View File

@ -135,6 +135,7 @@ module.exports = function(RED) {
buf.copy(m,0,0,i+1);
if (node.serialConfig.bin !== "bin") { m = m.toString(); }
node.send({"payload": m});
m = null;
}, node.serialConfig.newline);
i = 0;
buf[0] = msg;
@ -149,6 +150,7 @@ module.exports = function(RED) {
buf.copy(m,0,0,i-1);
if (node.serialConfig.bin !== "bin") { m = m.toString(); }
node.send({"payload":m});
m = null;
i = 0;
}
}
@ -161,6 +163,7 @@ module.exports = function(RED) {
buf.copy(m,0,0,i);
if (node.serialConfig.bin !== "bin") { m = m.toString(); }
node.send({"payload":m});
m = null;
i = 0;
}
}

View File

@ -152,6 +152,7 @@ module.exports = function(RED) {
if (err) {
node.error("udp : "+err);
}
message = null;
});
}
}