From 301dd092c2d04a5d70c94b9d873d810785e94a84 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 1 Jan 2015 13:47:28 -0500 Subject: [PATCH] usb: Minor - properly free memory on get_device_config() error path Signed-off-by: Kevin O'Connor --- src/hw/usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hw/usb.c b/src/hw/usb.c index 46e17df..1b4ea8b 100644 --- a/src/hw/usb.c +++ b/src/hw/usb.c @@ -253,8 +253,10 @@ get_device_config(struct usb_pipe *pipe) return NULL; req.wLength = cfg.wTotalLength; ret = usb_send_default_control(pipe, &req, config); - if (ret) + if (ret) { + free(config); return NULL; + } //hexdump(config, cfg.wTotalLength); return config; } -- 2.39.5