]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage_conf: plug a leak on OOM error path
authorJim Meyering <meyering@redhat.com>
Mon, 18 Jan 2010 17:40:13 +0000 (18:40 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 19 Jan 2010 17:19:13 +0000 (18:19 +0100)
* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
Free just-allocated "source" upon VIR_REALLOC_N failure.

src/conf/storage_conf.c

index 0aefa06f6e4e3553daa44d8423e0ff2f75eb355e..ea4953172c1166c017ea3cc0d5172c2941712b6d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * storage_conf.c: config handling for storage driver
  *
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -1695,6 +1695,7 @@ virStoragePoolSourceListNewSource(virConnectPtr conn,
     }
 
     if (VIR_REALLOC_N(list->sources, list->nsources+1) < 0) {
+        VIR_FREE(source);
         virReportOOMError(conn);
         return NULL;
     }