diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-01-01 13:47:28 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-01-07 10:13:46 -0500 |
commit | 301dd092c2d04a5d70c94b9d873d810785e94a84 (patch) | |
tree | 787ca6371505baa5436afb45576cead4d7714fd5 | |
parent | 2891a8323d4397a912123c066165ef9297b51607 (diff) | |
download | seabios-301dd092c2d04a5d70c94b9d873d810785e94a84.zip seabios-301dd092c2d04a5d70c94b9d873d810785e94a84.tar.gz seabios-301dd092c2d04a5d70c94b9d873d810785e94a84.tar.bz2 |
usb: Minor - properly free memory on get_device_config() error path
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/hw/usb.c | 4 |
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; } |