From fb8115cbc63a78cee3845d610f3dd3746bf6bde3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 4 Jan 2018 08:50:18 -0800 Subject: [PATCH] Scubapro G2 cleanup: avoid memory leak Coverity CID 207807 Signed-off-by: Dirk Hohndel Signed-off-by: Linus Torvalds --- src/scubapro_g2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scubapro_g2.c b/src/scubapro_g2.c index dcef627..c6c533f 100644 --- a/src/scubapro_g2.c +++ b/src/scubapro_g2.c @@ -245,7 +245,8 @@ scubapro_g2_device_open(dc_device_t **out, dc_context_t *context, const char *na const struct usb_id *id = get_usb_id(model); if (!id) { ERROR(context, "Unknown USB ID for Scubapro model %#04x", model); - return DC_STATUS_IO; + status = DC_STATUS_IO; + goto error_free; } status = dc_usbhid_custom_io(context, id->vendor, id->device); }