[libvirt] [PATCH] util: fix memleak in virStorageSourceClear

zhang bo oscar.zhangbo at huawei.com
Mon Apr 27 09:26:31 UTC 2015


snapshot and configFile are not freed, free them.

Signed-off-by: Zhang Bo <oscar.zhangbo at huawei.com>
---
 src/util/virstoragefile.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 9507ca1..6c3017c 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2038,6 +2038,8 @@ virStorageSourceClear(virStorageSourcePtr def)
 
     VIR_FREE(def->path);
     VIR_FREE(def->volume);
+    VIR_FREE(def->snapshot);
+    VIR_FREE(def->configFile);
     virStorageSourcePoolDefFree(def->srcpool);
     VIR_FREE(def->driverName);
     virBitmapFree(def->features);
-- 
1.7.12.4





More information about the libvir-list mailing list