mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
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>
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user