mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
plug four virStoragePoolSourceFree-related leaks
* src/conf/storage_conf.c (virStoragePoolDefParseSourceString): * src/storage/storage_backend_fs.c: (virStorageBackendFileSystemNetFindPoolSourcesFunc): (virStorageBackendFileSystemNetFindPoolSources): * src/test/test_driver.c (testStorageFindPoolSources):
This commit is contained in:
parent
b39ea45292
commit
18e0cc7f72
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user