]> xenbits.xensource.com Git - libvirt.git/commitdiff
virNetworkObjListFree: Accept NULL
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Feb 2015 15:19:54 +0000 (16:19 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 4 Mar 2015 09:09:10 +0000 (10:09 +0100)
All of our vir*Free() functions should accept NULL, even though
that there's no way of actually passing NULL with current code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/network_conf.c

index 154a9bc7a294eb165e82b8aa60828795a7e0e46d..9734a7f862fc9953f595660ee43fc76e1a818026 100644 (file)
@@ -279,6 +279,9 @@ void virNetworkObjListFree(virNetworkObjListPtr nets)
 {
     size_t i;
 
+    if (!nets)
+        return;
+
     for (i = 0; i < nets->count; i++)
         virNetworkObjFree(nets->objs[i]);