mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-16 04:01:31 +00:00
efi_loader: memory leak in append value
When printing an UEFI variable an error may arise while converting an illegal hexadecimal value. In this case a buffer is leaked. Close the memory leak. Provide an error message. Reported-by: Coverity (CID 185830) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
39a1ff8cea
commit
45203e0ccb
1 changed files with 4 additions and 1 deletions
|
@ -291,8 +291,11 @@ static int append_value(char **bufp, size_t *sizep, char *data)
|
|||
if (!tmp_buf)
|
||||
return -1;
|
||||
|
||||
if (hex2bin((u8 *)tmp_buf, data, len) < 0)
|
||||
if (hex2bin((u8 *)tmp_buf, data, len) < 0) {
|
||||
printf("Error: illegal hexadecimal string\n");
|
||||
free(tmp_buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = tmp_buf;
|
||||
} else { /* string */
|
||||
|
|
Loading…
Add table
Reference in a new issue