From ec010a55e7de72f493b1c53b2cb10c6bc433fd58 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Fri, 16 Jan 2015 06:40:15 -0500 Subject: [PATCH] network: Resolve Coverity FORWARD_NULL Commit id 'ca481a6f' added virNetworkRouteDefFree which may be called in an error path from lxcAddNetworkRouteDefinition with 'route = NULL'. So just add the (!def) at the top to resolve. --- src/conf/networkcommon_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c index 3f0896d6b2..7b7a851351 100644 --- a/src/conf/networkcommon_conf.c +++ b/src/conf/networkcommon_conf.c @@ -52,6 +52,8 @@ struct _virNetworkRouteDef { void virNetworkRouteDefFree(virNetworkRouteDefPtr def) { + if (!def) + return; VIR_FREE(def->family); VIR_FREE(def); }