Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/62724 )
Change subject: pony_spi.c: Fix memory leak in function pony_init_spi ......................................................................
pony_spi.c: Fix memory leak in function pony_init_spi
The issue was found by running scan-build. Memory leak was caused as data variable wasn't deallocated in some error cases where the function returned without deallocating it. After making the change, the issue no longer appeared in scan-build.
Change-Id: I7910db94f63693e7f131836d4963e88cfdbec301 Signed-off-by: Aarya Chaumal aarya.chaumal@gmail.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/62724 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Singer felixsinger@posteo.net Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Anastasia Klimchuk aklm@chromium.org --- M pony_spi.c 1 file changed, 1 insertion(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, but someone else must approve Felix Singer: Looks good to me, but someone else must approve Anastasia Klimchuk: Looks good to me, approved
diff --git a/pony_spi.c b/pony_spi.c index 86ef238..a3ac274 100644 --- a/pony_spi.c +++ b/pony_spi.c @@ -161,6 +161,7 @@ if (!have_device) { msg_perr("Error: No valid device specified.\n" "Use flashrom -p pony_spi:dev=/dev/device[,type=name]\n"); + free(data); return 1; }
8 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.