1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

print: Fix vendor string memory leak

Freeing this string won't really matter in the incredible case that we
run out of memory, but it keeps Coverity happy.

Change-Id: I962d2f2227850473b70272bc48b3fc0a0fb11342
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 1403822
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34849
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
This commit is contained in:
Jacob Garber 2019-08-12 14:31:46 -06:00 committed by Nico Huber
parent ba7199958c
commit 4a7970bc98

View File

@ -184,6 +184,7 @@ static int print_supported_chips(void)
dev = malloc(strlen(chip->name) + 1);
if (dev == NULL) {
msg_gerr("Out of memory!\n");
free(ven);
return 1;
}
strcpy(dev, chip->name);