!31 lxc: fix hook memory leak

Merge pull request !31 from lifeng_isula/master
This commit is contained in:
openeuler-ci-bot 2020-05-11 14:12:59 +08:00 committed by Gitee
commit c06af99cd4
4 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From 5cff3f195151267b65c88c1412aa9553fa1e0510 Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68@huawei.com>
Date: Mon, 11 May 2020 12:14:30 +0800
Subject: [PATCH] hook: fix memeory leak
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
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

View File

@ -0,0 +1,26 @@
From c08e50a792a088715e6752e5f93f8dff65f7cf27 Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68@huawei.com>
Date: Mon, 11 May 2020 14:00:17 +0800
Subject: [PATCH] termainal: fix console log memory leak
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
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

View File

@ -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)

View File

@ -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