diff options
author | Patrick Georgi <pgeorgi@google.com> | 2020-04-23 09:33:52 +0200 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2020-04-24 08:21:55 +0000 |
commit | 0916a347e2a4c130da22c867ed5040cec339aae6 (patch) | |
tree | ea455e2498606bdb081d37b061f37b9b537080e5 | |
parent | 1cef9369234c99a2c23d319c11e48715e5cc07ef (diff) | |
download | flashrom-0916a347e2a4c130da22c867ed5040cec339aae6.tar.gz flashrom-0916a347e2a4c130da22c867ed5040cec339aae6.tar.bz2 flashrom-0916a347e2a4c130da22c867ed5040cec339aae6.zip |
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>
-rw-r--r-- | usb_device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usb_device.c b/usb_device.c index 48833fbd..344c4cb9 100644 --- a/usb_device.c +++ b/usb_device.c @@ -226,6 +226,8 @@ int usb_device_find(struct usb_match const *match, struct usb_device **devices) &descriptor)); if (ret != 0) { msg_perr("USB: Failed to get device descriptor"); + free(*devices); + *devices = NULL; return ret; } |