diff --git a/inference-engine/thirdparty/movidius/mvnc/src/mvnc_api.c b/inference-engine/thirdparty/movidius/mvnc/src/mvnc_api.c index 961e45426b4..fb4b63f4ab0 100644 --- a/inference-engine/thirdparty/movidius/mvnc/src/mvnc_api.c +++ b/inference-engine/thirdparty/movidius/mvnc/src/mvnc_api.c @@ -802,10 +802,10 @@ ncStatus_t ncDeviceOpen(struct ncDeviceHandle_t **deviceHandlePtr, d->wd_interval = watchdogInterval; *deviceHandlePtr = dH; } else { - GLOBAL_UNLOCK(); mvLog(MVLOG_ERROR, "Memory allocation failed"); free(d); free(dH); + GLOBAL_UNLOCK(); return NC_OUT_OF_MEMORY; }