From: openocd-gerrit <ope...@us...> - 2023-09-17 12:13:29
|
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 8bbbff185ff97102f7b0db4f1aee7f4d81a06e7d (commit) from 300fe1d405729aa6bd64bc1287c6c45735624092 (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 8bbbff185ff97102f7b0db4f1aee7f4d81a06e7d Author: Antonio Borneo <bor...@gm...> Date: Sat Sep 9 09:24:59 2023 +0200 flash: npcx: fix memory leak in npcx_flash_bank_command Recent commit 62f76b216930 ("flash/nor: add support for Nuvoton NPCX4/K3 series flash") introduces a memory leak for a missing free() on early return for an error. Add the free() on the return path on error. Change-Id: Ica8568a986802e23df2ab7bed4e8cc4bbb6305a5 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 62f76b216930 ("flash/nor: add support for Nuvoton NPCX4/K3 series flash") Reviewed-on: https://review.openocd.org/c/openocd/+/7894 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/npcx.c b/src/flash/nor/npcx.c index 7304a6841..4a301f1e9 100644 --- a/src/flash/nor/npcx.c +++ b/src/flash/nor/npcx.c @@ -321,6 +321,7 @@ FLASH_BANK_COMMAND_HANDLER(npcx_flash_bank_command) npcx_bank->fiu_ver = NPCX_FIU_NPCK; } else { LOG_ERROR("%s is not a valid fiu", fiu); + free(npcx_bank); return ERROR_TARGET_INVALID; } } ----------------------------------------------------------------------- Summary of changes: src/flash/nor/npcx.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Main OpenOCD repository |