From: Osier Yang Date: Tue, 20 Aug 2013 09:08:49 +0000 (+0800) Subject: storage: Fix the use-after-free memory bug X-Git-Tag: v1.1.2-rc1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4140dbedd9d2733b2beb1fda0878ad742f1122d2;p=thirdparty%2Flibvirt.git storage: Fix the use-after-free memory bug Introduced by commit e0139e30444. virStorageVolDefFree free'ed the pointers that are still used by the added volume object, this changes it back to VIR_FREE. --- diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 58d0fc0d41..323be9e3bf 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1618,7 +1618,7 @@ storageVolCreateXML(virStoragePoolPtr obj, cleanup: virObjectUnref(volobj); virStorageVolDefFree(voldef); - virStorageVolDefFree(buildvoldef); + VIR_FREE(buildvoldef); if (pool) virStoragePoolObjUnlock(pool); return ret;