提交 fd2b4157 编写于 作者: O Osier Yang

Coverity: Fix resource leak in virnetlink.c

上级 739cfc31
......@@ -347,11 +347,13 @@ virNetlinkEventServiceStart(void)
if (VIR_ALLOC(srv) < 0) {
virReportOOMError();
goto error;
return -1;
}
if (virMutexInit(&srv->lock) < 0)
goto error;
if (virMutexInit(&srv->lock) < 0) {
VIR_FREE(srv);
return -1;
}
virNetlinkEventServerLock(srv);
......@@ -410,7 +412,6 @@ error_locked:
virMutexDestroy(&srv->lock);
VIR_FREE(srv);
}
error:
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册