aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch
diff options
context:
space:
mode:
authorXufeng Zhang <xufeng.zhang@windriver.com>2014-10-31 09:31:50 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-11-19 15:21:03 +0100
commit26f11117088d46a56494c348736fd73b7869c59d (patch)
tree35b9dd8c4adc9b26a79781a8c65cecdde1674447 /meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch
parent3243648a188b47ee905c24122352e32bb3e29e60 (diff)
downloadmeta-openembedded-26f11117088d46a56494c348736fd73b7869c59d.tar.gz
syslog-ng: Fix memory leak when udp connection is used [ LIN7-1379 ]
When udp connection is used, there are several memory leaks happen after run a long time. Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch')
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch b/meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch
new file mode 100644
index 0000000000..9e3d64bbf2
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/logwriter-dont-allocate-a-new-buffer.patch
@@ -0,0 +1,26 @@
+logwriter: Don't allocate a new buffer if fails to consume current item
+
+Upstream-Status: Pending
+
+Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
+---
+--- a/lib/logwriter.c
++++ b/lib/logwriter.c
+@@ -1010,7 +1010,7 @@
+ {
+ status = log_proto_client_post(proto, (guchar *) self->line_buffer->str, self->line_buffer->len, &consumed);
+
+- if (consumed)
++ if (consumed && status != LPS_ERROR)
+ log_writer_realloc_line_buffer(self);
+
+ if (status == LPS_ERROR)
+@@ -1028,7 +1028,7 @@
+ NULL);
+ consumed = TRUE;
+ }
+- if (consumed)
++ if (consumed && status != LPS_ERROR)
+ {
+ if (lm->flags & LF_LOCAL)
+ step_sequence_number(&self->seq_num);