1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

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 <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Michal Privoznik 2020-12-15 20:04:58 +01:00
parent 4ab1e3bce7
commit 6ac44c6334

View File

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