[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 04/14] util: Resolve resource leak for 'res' in virSetInherit error path.



---
 src/util/virlockspace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 9ada6a6..04aeebe 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -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) {
-- 
1.7.11.7


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]