Nico Huber has submitted this change. ( https://review.coreboot.org/c/flashrom/+/58583 )
Change subject: pony_spi: fix memory leak ......................................................................
pony_spi: fix memory leak
Free data if sp_openserport() fails and pony_spi_init() returns early with 1.
Change-Id: I11858bd0bdfe8b6d03af616fe4be4fb047b8dcd9 Signed-off-by: Thomas Heijligen thomas.heijligen@secunet.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/58583 Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M pony_spi.c 1 file changed, 1 insertion(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/pony_spi.c b/pony_spi.c index 6005bd4..86ef238 100644 --- a/pony_spi.c +++ b/pony_spi.c @@ -145,6 +145,7 @@ sp_fd = sp_openserport(arg, 9600); if (sp_fd == SER_INV_FD) { free(arg); + free(data); return 1; } if (register_shutdown(pony_spi_shutdown, data) != 0) {