Fix storage driver null dereference.

This commit is contained in:
Cole Robinson 2008-12-22 16:30:57 +00:00
parent bd24695a23
commit 922f5e6845
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Mon Dec 22 11:33:16 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/storage_driver.c: Fix storage driver null dereference.
Mon Dec 22 11:27:52 EST 2008 Cole Robinson <crobinso@redhat.com> Mon Dec 22 11:27:52 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/virsh.c: Merge xml building for virsh pool-*-as * src/virsh.c: Merge xml building for virsh pool-*-as

View File

@ -544,12 +544,13 @@ storagePoolDefine(virConnectPtr conn,
if (!(pool = virStoragePoolObjAssignDef(conn, &driver->pools, def))) if (!(pool = virStoragePoolObjAssignDef(conn, &driver->pools, def)))
goto cleanup; goto cleanup;
def = NULL;
if (virStoragePoolObjSaveDef(conn, driver, pool, def) < 0) { if (virStoragePoolObjSaveDef(conn, driver, pool, def) < 0) {
virStoragePoolObjRemove(&driver->pools, pool); virStoragePoolObjRemove(&driver->pools, pool);
def = NULL;
goto cleanup; goto cleanup;
} }
def = NULL;
ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid); ret = virGetStoragePool(conn, pool->def->name, pool->def->uuid);