lxc/0047-Fix-memory-leak-in-lxc_global_config_value.patch
2019-09-30 11:03:07 -04:00

45 lines
1.2 KiB
Diff

From ec20a5a0e68d0b70ec0014d3f34385cdd3c44370 Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68@huawei.com>
Date: Thu, 17 Jan 2019 07:43:23 -0500
Subject: [PATCH 047/122] Fix memory leak in lxc_global_config_value
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
src/lxc/cgroups/cgroup.c | 2 ++
src/lxc/initutils.c | 5 -----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c
index 720a6c9..8d559be 100644
--- a/src/lxc/cgroups/cgroup.c
+++ b/src/lxc/cgroups/cgroup.c
@@ -95,6 +95,8 @@ void cgroup_exit(struct cgroup_ops *ops)
}
free(ops->hierarchies);
+ free(ops);
+
return;
}
diff --git a/src/lxc/initutils.c b/src/lxc/initutils.c
index 09b521e..60147a5 100644
--- a/src/lxc/initutils.c
+++ b/src/lxc/initutils.c
@@ -74,12 +74,7 @@ const char *lxc_global_config_value(const char *option_name)
{ NULL, NULL },
};
- /* placed in the thread local storage pool for non-bionic targets */
-#ifdef HAVE_TLS
- static thread_local const char *values[sizeof(options) / sizeof(options[0])] = {0};
-#else
static const char *values[sizeof(options) / sizeof(options[0])] = {0};
-#endif
/* user_config_path is freed as soon as it is used */
char *user_config_path = NULL;
--
1.8.3.1