1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

util: Resolve resource leak for 'res' in virSetInherit error path.

This commit is contained in:
John Ferlan 2013-01-09 09:54:10 -05:00 committed by Ján Tomko
parent 584cd5c279
commit 4f85cfdfad

View File

@ -387,6 +387,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
if (virSetInherit(res->fd, false) < 0) {
virReportSystemError(errno, "%s",
_("Cannot enable close-on-exec flag"));
virLockSpaceResourceFree(res);
goto error;
}
if (virJSONValueObjectGetBoolean(child, "lockHeld", &res->lockHeld) < 0) {