Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
libflashrom: Free `chip` instance upon flashctx teardown

Change-Id: I761d7e167a43e5bf08b5b3d269b0a476e3d343c5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/33546
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M libflashrom.c
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/libflashrom.c b/libflashrom.c
index cb0d470..d0f94a9 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -331,6 +331,7 @@
/* We found one chip, now check that there is no second match. */
if (probe_flash(&registered_masters[i], flash_idx + 1, &second_flashctx, 0) != -1) {
flashrom_layout_release(second_flashctx.default_layout);
+ free(second_flashctx.chip);
ret = 3;
break;
}
@@ -362,6 +363,7 @@
void flashrom_flash_release(struct flashrom_flashctx *const flashctx)
{
flashrom_layout_release(flashctx->default_layout);
+ free(flashctx->chip);
free(flashctx);
}


To view, visit change 33546. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I761d7e167a43e5bf08b5b3d269b0a476e3d343c5
Gerrit-Change-Number: 33546
Gerrit-PatchSet: 10
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Daniel Campello <campello@chromium.org>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged