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 <jgarber1@ualberta.ca>
Found-by: Coverity CID 1230664, 1230665
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34846
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
diff --git a/board_enable.c b/board_enable.c
index 74612f5..042ce12 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -2516,7 +2516,7 @@
* 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);