mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
Coverity: Fix resource leak in virnetlink.c
(cherry picked from commit fd2b41574e
)
This commit is contained in:
parent
707624b3d9
commit
655d3b2b87
@ -337,11 +337,13 @@ virNetlinkEventServiceStart(void)
|
|||||||
|
|
||||||
if (VIR_ALLOC(srv) < 0) {
|
if (VIR_ALLOC(srv) < 0) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto error;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virMutexInit(&srv->lock) < 0)
|
if (virMutexInit(&srv->lock) < 0) {
|
||||||
goto error;
|
VIR_FREE(srv);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virNetlinkEventServerLock(srv);
|
virNetlinkEventServerLock(srv);
|
||||||
|
|
||||||
@ -400,7 +402,6 @@ error_locked:
|
|||||||
virMutexDestroy(&srv->lock);
|
virMutexDestroy(&srv->lock);
|
||||||
VIR_FREE(srv);
|
VIR_FREE(srv);
|
||||||
}
|
}
|
||||||
error:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user