mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: Resolve resource leak for 'res' in virSetInherit error path.
This commit is contained in:
parent
584cd5c279
commit
4f85cfdfad
@ -387,6 +387,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object)
|
|||||||
if (virSetInherit(res->fd, false) < 0) {
|
if (virSetInherit(res->fd, false) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Cannot enable close-on-exec flag"));
|
_("Cannot enable close-on-exec flag"));
|
||||||
|
virLockSpaceResourceFree(res);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectGetBoolean(child, "lockHeld", &res->lockHeld) < 0) {
|
if (virJSONValueObjectGetBoolean(child, "lockHeld", &res->lockHeld) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user