mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +02:00
raiden_debug_spi: Fix memleak
Change-Id: I2701a8fbae63657edc9cc258666cc951f92b1115 Found-by: Coverity Scan #1420204 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/40650 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
parent
577c6b7fb9
commit
1cef936923
@ -480,12 +480,14 @@ int raiden_debug_spi_init(void)
|
|||||||
ret = LIBUSB(libusb_init(NULL));
|
ret = LIBUSB(libusb_init(NULL));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("Raiden: libusb_init failed\n");
|
msg_perr("Raiden: libusb_init failed\n");
|
||||||
|
free(serial);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = usb_device_find(&match, ¤t);
|
ret = usb_device_find(&match, ¤t);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("Raiden: Failed to find devices\n");
|
msg_perr("Raiden: Failed to find devices\n");
|
||||||
|
free(serial);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -546,6 +548,7 @@ loop_end:
|
|||||||
|
|
||||||
if (!device || !found) {
|
if (!device || !found) {
|
||||||
msg_perr("Raiden: No usable device found.\n");
|
msg_perr("Raiden: No usable device found.\n");
|
||||||
|
free(serial);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user