summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
commit1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch)
treea21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
downloadmeta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch')
-rw-r--r--meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
new file mode 100644
index 000000000..2ac9c0be0
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
@@ -0,0 +1,27 @@
1Fix the memory leak problem when HAVE_ENVIRON is defined
2
3Upstream-Status: Pending
4
5Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
6---
7--- a/lib/gprocess.c
8+++ b/lib/gprocess.c
9@@ -1421,6 +1421,18 @@
10 void
11 g_process_finish(void)
12 {
13+#ifdef HAVE_ENVIRON
14+ int i = 0;
15+
16+ while (environ[i]) {
17+ g_free(environ[i]);
18+ ++i;
19+ }
20+ if (environ)
21+ g_free(environ);
22+ if (process_opts.argv_orig)
23+ free(process_opts.argv_orig);
24+#endif
25 g_process_remove_pidfile();
26 }
27