api: Fix possible descriptor leak, found by Coverity Scan

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-12-24 10:02:49 +01:00
parent cbafbaea1d
commit 9e8a01669e
+2 -4
View File
@@ -380,13 +380,11 @@ static void api_cb(uev_t *w, void *arg, int events)
_d("Failed sending ACK/NACK back to client");
}
if (UEV_ERROR == events)
goto error;
leave:
close(sd);
if (UEV_ERROR == events)
goto error;
return;
error:
api_exit();
if (api_init(w->ctx))