diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 23526371d508f1b3d9f93cac431411d50a2b76ea..eefa55f11d03576be62d65b185d7b2dd46b9c2e9 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -517,8 +517,8 @@ virStoragePoolDefParseSourceString(const char *srcSpec, ret = def; def = NULL; cleanup: - if (def) - virStoragePoolSourceFree(def); + virStoragePoolSourceFree(def); + VIR_FREE(def); xmlFreeDoc(doc); xmlXPathFreeContext(xpath_ctxt); diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 03ba43a449596e904136cc026f1f4c775cf6d63a..bbd5787a10333787fe8633d60c390a3d20019179 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -172,8 +172,8 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTR src = NULL; ret = 0; cleanup: - if (src) - virStoragePoolSourceFree(src); + virStoragePoolSourceFree(src); + VIR_FREE(src); return ret; } @@ -234,8 +234,8 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSE for (i = 0; i < state.list.nsources; i++) virStoragePoolSourceFree(&state.list.sources[i]); - if (source) - virStoragePoolSourceFree(source); + virStoragePoolSourceFree(source); + VIR_FREE(source); VIR_FREE(state.list.sources); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a17217a6d98a296ca290ec4758cbca242db6dd6f..d552f032b7d0e522edccc4a4b7a1872ed94411be 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1,7 +1,7 @@ /* * test.c: A "mock" hypervisor for use by application unit tests * - * Copyright (C) 2006-2009 Red Hat, Inc. + * Copyright (C) 2006-2010 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or @@ -3766,6 +3766,7 @@ testStorageFindPoolSources(virConnectPtr conn, cleanup: virStoragePoolSourceFree(source); + VIR_FREE(source); return ret; }