Fix a memory leak in the error handling

This commit is contained in:
Jef Driesen 2018-09-20 21:41:19 +02:00
parent a2100843b9
commit 96949627aa

View File

@ -668,12 +668,12 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream
status = dc_iostream_set_dtr(device->iostream, 1);
if (status != DC_STATUS_SUCCESS) {
ERROR (context, "Failed to set the DTR line.");
return status;
goto error_free;
}
status = dc_iostream_set_rts(device->iostream, 1);
if (status != DC_STATUS_SUCCESS) {
ERROR (context, "Failed to set the DTR line.");
return status;
goto error_free;
}
// Make sure everything is in a sane state.