From: Michal Privoznik Date: Mon, 23 Feb 2015 15:19:54 +0000 (+0100) Subject: virNetworkObjListFree: Accept NULL X-Git-Tag: v1.2.14-rc1~283 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b86f9aa1c2f066f9ec56dd482fcbf74bfd273e1;p=thirdparty%2Flibvirt.git virNetworkObjListFree: Accept NULL 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 --- diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 154a9bc7a2..9734a7f862 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -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]);