From 1c091d1aebb055149c89f88fd5766ca4e33b7b3e Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Mon, 12 Aug 2019 11:14:14 -0600 Subject: internal: Fix board vendor and model memory leaks The board vendor and model are sometimes specified as arguments during an internal flash, so make sure they are freed at the end of initialization. Change-Id: I9f43708f3b075896be67acec114bc6f390f8c6ca Signed-off-by: Jacob Garber Found-by: Coverity CID 1230664, 1230665 Reviewed-on: https://review.coreboot.org/c/flashrom/+/34846 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks --- board_enable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board_enable.c') diff --git a/board_enable.c b/board_enable.c index 74612f59d..042ce1223 100644 --- a/board_enable.c +++ b/board_enable.c @@ -2516,7 +2516,7 @@ int selfcheck_board_enables(void) * Parameters vendor and model will be overwritten. Returns 0 on success. * Note: strtok modifies the original string, so we work on a copy and allocate memory for the results. */ -int board_parse_parameter(const char *boardstring, const char **vendor, const char **model) +int board_parse_parameter(const char *boardstring, char **vendor, char **model) { /* strtok may modify the original string. */ char *tempstr = strdup(boardstring); -- cgit v1.2.3