diff options
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.patch | 27 |
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 0000000000..2ac9c0be0f --- /dev/null +++ b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | Fix the memory leak problem when HAVE_ENVIRON is defined | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-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 | |||