[libvirt] [PATCH v2 5/14] locking: Resolve resource leaks on non error path

John Ferlan jferlan at redhat.com
Tue Jan 15 14:23:29 UTC 2013


Both 'dir' and 'path' were not free'd on successful return
---
 src/locking/lock_driver_sanlock.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index d06fa66..0b7c6d5 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -365,6 +365,8 @@ retry:
         VIR_DEBUG("Lockspace %s has been registered", path);
     }
 
+    VIR_FREE(path);
+    VIR_FREE(dir);
     return 0;
 
 error_unlink:
-- 
1.7.11.7




More information about the libvir-list mailing list