From ead2df32ba57515ce0ac75a564e1c617de359d20 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Fri, 18 Sep 2015 13:22:46 -0400 Subject: [PATCH] interface: fail on OOM from virGetInterface() --- src/interface/interface_backend_netcf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index 947f1e2d0d..9f745411e8 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -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; }