[libvirt] [PATCH 14/23] Fix leak in virLockSpaceResourceFree

Daniel P. Berrange berrange at redhat.com
Wed Sep 25 14:51:09 UTC 2013


From: "Daniel P. Berrange" <berrange at redhat.com>

Normally a lockspace resource is not freed while there are
active owners. During initial resource creation though, an
OOM error will trigger this scenario. virLockSpaceResourceFree
was not freeing the 'owners' field in this case.

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 src/util/virlockspace.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index afb1abb..cab7775 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -102,6 +102,7 @@ static void virLockSpaceResourceFree(virLockSpaceResourcePtr res)
         }
     }
 
+    VIR_FREE(res->owners);
     VIR_FORCE_CLOSE(res->fd);
     VIR_FREE(res->path);
     VIR_FREE(res->name);
-- 
1.8.3.1




More information about the libvir-list mailing list