libpayload/drivers: Fix mem-leak in cbmem_console error condition
When returning from cbmem_console_snapshot() because of a corrupted console structure, the memory that was just allocated was not being freed as it "should be". BUG=CID 1419477 Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I85370fb49c9ef9a00cd2ea516fa80c9e152c9b48 Reviewed-on: https://review.coreboot.org/c/coreboot/+/88334 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
parent
1219981177
commit
05396238da
1 changed files with 1 additions and 0 deletions
|
|
@ -126,6 +126,7 @@ char *cbmem_console_snapshot(void)
|
|||
if (overflow) {
|
||||
if (cursor >= size) {
|
||||
printf("ERROR: CBMEM console struct is corrupted\n");
|
||||
free(console_c);
|
||||
return NULL;
|
||||
}
|
||||
for (oldc = cursor; oldc < size; oldc++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue