9
0
Fork 0

scripts: imx-usb-loader: Fix memory leak

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Alexander Shiyan 2014-01-29 22:21:49 +04:00 committed by Sascha Hauer
parent 303c3d1e24
commit 9ef62b72ef
1 changed files with 4 additions and 1 deletions

View File

@ -1334,7 +1334,7 @@ static void usage(const char *prgname)
int main(int argc, char *argv[])
{
struct usb_id *p_id;
struct usb_id *p_id = NULL;
struct mach_id *mach;
libusb_device **devs;
libusb_device *dev;
@ -1432,6 +1432,9 @@ int main(int argc, char *argv[])
ret = 0;
out:
if (p_id)
free(p_id);
if (h)
libusb_close(h);