]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virStoragePoolSourceListNewSource: avoid unconditional leak
authorJim Meyering <meyering@redhat.com>
Tue, 2 Feb 2010 18:59:14 +0000 (19:59 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 3 Feb 2010 14:46:59 +0000 (15:46 +0100)
* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
Remove an unused (and leaked) allocation.

src/conf/storage_conf.c

index bd34f5e4b86bbc0e0d12a646ad66509d47bb1fce..62b8394d6039ae3cc64f405ca40905f6da0ce8a0 100644 (file)
@@ -1694,13 +1694,7 @@ virStoragePoolSourceListNewSource(virConnectPtr conn,
 {
     virStoragePoolSourcePtr source;
 
-    if (VIR_ALLOC(source) < 0) {
-        virReportOOMError(conn);
-        return NULL;
-    }
-
     if (VIR_REALLOC_N(list->sources, list->nsources+1) < 0) {
-        VIR_FREE(source);
         virReportOOMError(conn);
         return NULL;
     }