]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
interface: fail on OOM from virGetInterface()
authorLaine Stump <laine@laine.org>
Fri, 18 Sep 2015 17:22:46 +0000 (13:22 -0400)
committerLaine Stump <laine@laine.org>
Fri, 2 Oct 2015 15:16:11 +0000 (11:16 -0400)
src/interface/interface_backend_netcf.c

index 947f1e2d0daea5421a46ed0d2b29538bb8a34a70..9f745411e8592c27bdd325699807875ec373095b 100644 (file)
@@ -2,7 +2,7 @@
  * interface_backend_netcf.c: backend driver methods to handle physical
  *                            interface configuration using the netcf library.
  *
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -629,8 +629,9 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
         }
 
         if (ifaces) {
-            iface_obj = virGetInterface(conn, ncf_if_name(iface),
-                                        ncf_if_mac_string(iface));
+            if (!(iface_obj = virGetInterface(conn, ncf_if_name(iface),
+                                              ncf_if_mac_string(iface))))
+                goto cleanup;
             tmp_iface_objs[niface_objs++] = iface_obj;
         }