代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8905d508d754a6d75516bbf26839848f4dfef282 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Mon, 29 Jan 2024 19:11:45 +0800
Subject: [PATCH] fix t_params double free
---
src/lstack/core/lstack_protocol_stack.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/lstack/core/lstack_protocol_stack.c b/src/lstack/core/lstack_protocol_stack.c
index 800872b..bb7ec17 100644
--- a/src/lstack/core/lstack_protocol_stack.c
+++ b/src/lstack/core/lstack_protocol_stack.c
@@ -660,7 +660,7 @@ int32_t stack_setup_thread(void)
for (uint32_t i = 0; i < queue_num; ++i) {
t_params[i] = malloc(sizeof(struct thread_params));
if (t_params[i] == NULL) {
- goto OUT;
+ goto OUT1;
}
}
@@ -669,18 +669,18 @@ int32_t stack_setup_thread(void)
if (i % 2 == 0) {
ret = sprintf_s(name, sizeof(name), "%s_%d_%d", LSTACK_RECV_THREAD_NAME, process_index, i / 2);
if (ret < 0) {
- goto OUT;
+ goto OUT1;
}
} else {
ret = sprintf_s(name, sizeof(name), "%s_%d_%d", LSTACK_SEND_THREAD_NAME, process_index, i / 2);
if (ret < 0) {
- goto OUT;
+ goto OUT1;
}
}
} else {
ret = sprintf_s(name, sizeof(name), "%s", LSTACK_THREAD_NAME);
if (ret < 0) {
- goto OUT;
+ goto OUT1;
}
}
@@ -689,24 +689,26 @@ int32_t stack_setup_thread(void)
ret = create_thread((void *)t_params[i], name, gazelle_stack_thread);
if (ret != 0) {
- goto OUT;
+ goto OUT1;
}
}
/* 2: wait stack thread and kernel_event thread init finish */
wait_sem_value(&g_stack_group.sem_stack_setup, queue_num * 2);
if (g_stack_group.stack_setup_fail) {
- goto OUT;
+ /* t_params free by stack thread */
+ goto OUT2;
}
g_stack_group.stack_num = queue_num;
return 0;
-OUT:
+OUT1:
for (int32_t i = 0; i < queue_num; ++i) {
if (t_params[i] != NULL) {
free(t_params[i]);
}
}
+OUT2:
return -1;
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。