[libvirt] PATCH: Fix leak in storage driver

Daniel P. Berrange berrange at redhat.com
Fri Jan 30 11:43:03 UTC 2009


A recent change to keep the storage pools active upon shutdown, exposed a
minor flaw in the code which free's a virStoragePoolObj instance. It
never free's the associated volumes, since it presumed you'd never free
a pool, which was still active. A bogus assumption, causing  us to leak
memory upon daemon shutdown, thus annoying valgrind. 

Daniel

diff -r 3e95abd6df89 src/storage_conf.c
--- a/src/storage_conf.c	Fri Jan 30 11:01:10 2009 +0000
+++ b/src/storage_conf.c	Fri Jan 30 11:01:29 2009 +0000
@@ -296,6 +296,8 @@ virStoragePoolObjFree(virStoragePoolObjP
     if (!obj)
         return;
 
+    virStoragePoolObjClearVols(obj);
+
     virStoragePoolDefFree(obj->def);
     virStoragePoolDefFree(obj->newDef);
 


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list