File libvirt-locking-Resolve-resource-leaks-on-non-error-path.patch of Package libvirt
From 4f0cd87bd91454e6b1afab5c8abf1f10705de082 Mon Sep 17 00:00:00 2001
Message-Id: <4f0cd87bd91454e6b1afab5c8abf1f10705de082.1373271640.git.jdenemar@redhat.com>
From: John Ferlan <jferlan@redhat.com>
Date: Thu, 14 Mar 2013 11:19:09 -0400
Subject: [PATCH] locking: Resolve resource leaks on non error path
https://bugzilla.redhat.com/show_bug.cgi?id=906299
Both 'dir' and 'path' were not free'd on successful return
(cherry picked from commit 687554cd503b210347582e63c31c87f5bbb2f7ba)
---
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 82b4515..3c9d7c2 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.8.2.1