Fetch the repository succeeded.
This action will force synchronization from src-openEuler/etmem, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
From 4bca2f765de38ce263cf5c7507c717b04395b012 Mon Sep 17 00:00:00 2001
From: liubo <liubo254@huawei.com>
Date: Mon, 13 Jun 2022 15:59:05 +0800
Subject: [PATCH 33/33] etmem: fix memory leak
In the configuration file parsing process, if the parameter
value is not configured, the val memory should be released.
When the project is deleted, the memory of the pid list
corresponding to the task needs to be released.
Signed-off-by: liubo <liubo254@huawei.com>
---
etmem/src/etmemd_src/etmemd_file.c | 8 +++++++-
etmem/src/etmemd_src/etmemd_slide.c | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/etmem/src/etmemd_src/etmemd_file.c b/etmem/src/etmemd_src/etmemd_file.c
index b7dc27f..d204685 100644
--- a/etmem/src/etmemd_src/etmemd_file.c
+++ b/etmem/src/etmemd_src/etmemd_file.c
@@ -35,7 +35,13 @@ static int parse_item(GKeyFile *config, char *group_name, struct config_item *it
break;
case STR_VAL:
val = (void *)g_key_file_get_string(config, group_name, item->key, &error);
- if (val == NULL || strlen(val) == 0) {
+ if (val == NULL) {
+ etmemd_log(ETMEMD_LOG_ERR, "section %s of group [%s] should not be empty\n", item->key, group_name);
+ return -1;
+ }
+
+ if (strlen(val) == 0) {
+ free(val);
etmemd_log(ETMEMD_LOG_ERR, "section %s of group [%s] should not be empty\n", item->key, group_name);
return -1;
}
diff --git a/etmem/src/etmemd_src/etmemd_slide.c b/etmem/src/etmemd_src/etmemd_slide.c
index 236778a..a3c474b 100644
--- a/etmem/src/etmemd_src/etmemd_slide.c
+++ b/etmem/src/etmemd_src/etmemd_slide.c
@@ -388,6 +388,7 @@ static void slide_stop_task(struct engine *eng, struct task *tk)
struct slide_params *params = tk->params;
stop_and_delete_threadpool_work(tk);
+ etmemd_free_task_pids(tk);
free(params->executor);
params->executor = NULL;
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。