From 898ce52455ea4f9983c1eb88926d3824eec54b63 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 28 Dec 2017 08:30:17 -0800 Subject: [PATCH] Cleanup: avoid memory leak Coverity CID 207807 Signed-off-by: Dirk Hohndel --- 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); }