aboutsummaryrefslogtreecommitdiff
path: root/src/hw
diff options
context:
space:
mode:
Diffstat (limited to 'src/hw')
-rw-r--r--src/hw/usb.c4
1 files changed, 3 insertions, 1 deletions
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;
}