mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
usb_device: Fix memory leak
Change-Id: I19c91ae881895ecc4ea85dcfd40a69bb58289a60 Found-by: Coverity Scan #1420203 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/40651 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
1cef936923
commit
0916a347e2
@ -226,6 +226,8 @@ int usb_device_find(struct usb_match const *match, struct usb_device **devices)
|
|||||||
&descriptor));
|
&descriptor));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("USB: Failed to get device descriptor");
|
msg_perr("USB: Failed to get device descriptor");
|
||||||
|
free(*devices);
|
||||||
|
*devices = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user