]> xenbits.xensource.com Git - libvirt.git/commitdiff
network: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Fri, 16 Jan 2015 11:40:15 +0000 (06:40 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 16 Jan 2015 11:40:15 +0000 (06:40 -0500)
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

index 3f0896d6b283f19d6df86688c0d7fe1c6660fa01..7b7a851351d9665b380d24b424ec57e7d1da18a2 100644 (file)
@@ -52,6 +52,8 @@ struct _virNetworkRouteDef {
 void
 virNetworkRouteDefFree(virNetworkRouteDefPtr def)
 {
+    if (!def)
+        return;
     VIR_FREE(def->family);
     VIR_FREE(def);
 }