storage: Fix the use-after-free memory bug

Introduced by commit e0139e3044. virStorageVolDefFree free'ed the
pointers that are still used by the added volume object, this changes
it back to VIR_FREE.
This commit is contained in:
Osier Yang 2013-08-20 17:08:49 +08:00
parent b8a0103d45
commit 4140dbedd9

View File

@ -1618,7 +1618,7 @@ storageVolCreateXML(virStoragePoolPtr obj,
cleanup: cleanup:
virObjectUnref(volobj); virObjectUnref(volobj);
virStorageVolDefFree(voldef); virStorageVolDefFree(voldef);
virStorageVolDefFree(buildvoldef); VIR_FREE(buildvoldef);
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
return ret; return ret;