coreboot/util/supermicro
Martin Roth c68645cd88 util/supermicro: Fix mem leak in get_line_as_int error conditions
When parsing the string, if it doesn't end with 0 or \n, get_line_as_int
returns -1, but wasn't freeing the buffer. Also if we got an empty
string with just null termination, that byte would also cause a leak, so
move the second free() to the bottom. It's always fine to free a null
pointer if the allocation failed.

BUG=CID 1419489

Change-Id: Ibb3a7544ec8c46820b6e47b6fd4bbe5cabafe1a8
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88335
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-08 16:18:31 +00:00
..
smcbiosinfo util/supermicro: Fix mem leak in get_line_as_int error conditions 2025-07-08 16:18:31 +00:00
description.md util: Make sure all util dirs have description files at top level 2021-01-04 23:08:16 +00:00
Makefile.mk util: Rename Makefiles from .inc to .mk 2024-01-26 12:43:18 +00:00