From 57c1bb954f9639c76ecebd4c2ec5a9a211faeea5 Mon Sep 17 00:00:00 2001 From: LiFeng Date: Mon, 11 May 2020 12:19:52 +0800 Subject: [PATCH] lxc: fix hook memory leak Signed-off-by: LiFeng --- 0063-hook-fix-memeory-leak.patch | 27 +++++++++++++++++++ ...ermainal-fix-console-log-memory-leak.patch | 26 ++++++++++++++++++ lxc.spec | 4 ++- series.conf | 2 ++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0063-hook-fix-memeory-leak.patch create mode 100644 0064-termainal-fix-console-log-memory-leak.patch diff --git a/0063-hook-fix-memeory-leak.patch b/0063-hook-fix-memeory-leak.patch new file mode 100644 index 0000000..3572b07 --- /dev/null +++ b/0063-hook-fix-memeory-leak.patch @@ -0,0 +1,27 @@ +From 5cff3f195151267b65c88c1412aa9553fa1e0510 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Mon, 11 May 2020 12:14:30 +0800 +Subject: [PATCH] hook: fix memeory leak + +Signed-off-by: LiFeng +--- + src/lxc/conf.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/lxc/conf.c b/src/lxc/conf.c +index ad32725..f46255a 100644 +--- a/src/lxc/conf.c ++++ b/src/lxc/conf.c +@@ -5447,6 +5447,9 @@ void lxc_conf_free(struct lxc_conf *conf) + lxc_clear_rootfs_ro_paths(conf); + free(conf->errmsg); + lxc_close_error_pipe(conf->errpipe); ++ if (conf->ocihooks) { ++ free_oci_runtime_spec_hooks(conf->ocihooks); ++ } + #endif + free(conf); + } +-- +1.8.3.1 + diff --git a/0064-termainal-fix-console-log-memory-leak.patch b/0064-termainal-fix-console-log-memory-leak.patch new file mode 100644 index 0000000..148de7b --- /dev/null +++ b/0064-termainal-fix-console-log-memory-leak.patch @@ -0,0 +1,26 @@ +From c08e50a792a088715e6752e5f93f8dff65f7cf27 Mon Sep 17 00:00:00 2001 +From: LiFeng +Date: Mon, 11 May 2020 14:00:17 +0800 +Subject: [PATCH] termainal: fix console log memory leak + +Signed-off-by: LiFeng +--- + src/lxc/terminal.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c +index 9b831dc..3d2960b 100644 +--- a/src/lxc/terminal.c ++++ b/src/lxc/terminal.c +@@ -2114,6 +2114,8 @@ void lxc_terminal_conf_free(struct lxc_terminal *terminal) + free(terminal->init_fifo[1]); + free(terminal->init_fifo[2]); + lxc_terminal_delete_fifo(-1, &terminal->fifos); ++ free(terminal->log_driver); ++ free(terminal->log_syslog_tag); + #endif + } + +-- +1.8.3.1 + diff --git a/lxc.spec b/lxc.spec index 1b57dda..4f0370e 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2020050702 +%global _release 2020051101 %global debug_package %{nil} Name: lxc @@ -70,6 +70,8 @@ Patch9058: 0059-set-state-to-stopped.patch Patch9059: 0060-attach-append-error-msg-when-call-attach-failed.patch Patch9060: 0061-mount-fix-symlink-error-use-parsed-path.patch Patch9061: 0062-change-log-level-of-seccomp-setup.patch +Patch9062: 0063-hook-fix-memeory-leak.patch +Patch9063: 0064-termainal-fix-console-log-memory-leak.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) diff --git a/series.conf b/series.conf index 2caf6d2..c80475c 100644 --- a/series.conf +++ b/series.conf @@ -60,3 +60,5 @@ 0060-attach-append-error-msg-when-call-attach-failed.patch 0061-mount-fix-symlink-error-use-parsed-path.patch 0062-change-log-level-of-seccomp-setup.patch +0063-hook-fix-memeory-leak.patch +0064-termainal-fix-console-log-memory-leak.patch -- Gitee