This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 1c31f6225f41dd2bd371571e829fbf6855788d24 (commit)
from 8d1dcf293a0cee71b264787c65749de3f6c4d8bc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1c31f6225f41dd2bd371571e829fbf6855788d24
Author: panciyan <pan...@es...>
Date: Fri Mar 31 15:12:08 2023 +0000
src/server: Fix memory leak of reg_list
memory leak of reg_list when local_list realloc fail.
Signed-off-by: panciyan <pan...@es...>
Change-Id: I6b09137ecd132ab326205f5a575a38bcc82e8469
Reviewed-on: https://review.openocd.org/c/openocd/+/7566
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index d8dbc2c8b..b15a6c1c3 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -2348,6 +2348,7 @@ static int smp_reg_list_noread(struct target *target,
local_list = realloc(local_list, combined_allocated * sizeof(struct reg *));
if (!local_list) {
LOG_ERROR("realloc(%zu) failed", combined_allocated * sizeof(struct reg *));
+ free(reg_list);
return ERROR_FAIL;
}
}
-----------------------------------------------------------------------
Summary of changes:
src/server/gdb_server.c | 1 +
1 file changed, 1 insertion(+)
hooks/post-receive
--
Main OpenOCD repository
|