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 <mpriv...@redhat.com>
---
 src/lxc/lxc_domain.c | 4 ++++
 1 file changed, 4 insertions(+)

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);
-- 
2.26.2

Reply via email to