From: Michal Privoznik Date: Tue, 15 Dec 2020 19:04:58 +0000 (+0100) Subject: lxc: Allow NULL argument to lxcDomainDefNamespaceFree() X-Git-Tag: v7.0.0-rc1~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ac44c6334381d6fb1aac55c98ac95684f545af6;p=thirdparty%2Flibvirt.git lxc: Allow NULL argument to lxcDomainDefNamespaceFree() As all other free functions, NULL should be accepted. Even though there currently is no caller that would pass NULL, there will be in future patches. Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index df60519fca..707262336b 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -195,6 +195,10 @@ lxcDomainDefNamespaceFree(void *nsdata) { size_t i; lxcDomainDefPtr lxcDef = nsdata; + + if (!lxcDef) + return; + for (i = 0; i < VIR_LXC_DOMAIN_NAMESPACE_LAST; i++) g_free(lxcDef->ns_val[i]); g_free(nsdata);