From: Jim Meyering Date: Tue, 2 Feb 2010 18:59:14 +0000 (+0100) Subject: virStoragePoolSourceListNewSource: avoid unconditional leak X-Git-Tag: v0.7.6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71c865f4d2826fa4907a104cfe4ff4b19cad44bf;p=thirdparty%2Flibvirt.git virStoragePoolSourceListNewSource: avoid unconditional leak * src/conf/storage_conf.c (virStoragePoolSourceListNewSource): Remove an unused (and leaked) allocation. --- diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index bd34f5e4b8..62b8394d60 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -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; }