]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: replace VIR_FREE() with g_free() in vir*Free() functions
authorLaine Stump <laine@redhat.com>
Sat, 30 Jan 2021 19:05:50 +0000 (14:05 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 2 Feb 2021 05:27:58 +0000 (00:27 -0500)
commitf9f81f1c8f855b8c21aeae4441abfc877ff2bfc3
tree49131c3e9ad97581984b93ac3a4df265bd4be8b7
parent45b2912c71e417b284f98c961329ce59d77f791e
conf: replace VIR_FREE() with g_free() in vir*Free() functions

This patch takes on one set of examples of unnecessary use of
VIR_FREE() when g_free() is adequate - it modifies only vir*Free()
functions within the conf directory that take a single pointer and
free the object pointed to by that argument before returning. The
modification is to replace VIR_FREE() with g_free() for the object
itself *and* for all subordinate chunks of memory pointed to by that
object.

(NB: there are other functions that VIR_FREE subordinate memory of
objects that end up being freed before return (also sometimes with
VIR_FREE); I am purposefully ignoring those to reduce scope and focus
on a sub class where the pointlessness is obvious.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 files changed:
src/conf/capabilities.c
src/conf/cpu_conf.c
src/conf/device_conf.c
src/conf/domain_addr.c
src/conf/domain_capabilities.c
src/conf/domain_conf.c
src/conf/interface_conf.c
src/conf/network_conf.c
src/conf/node_device_conf.c
src/conf/nwfilter_conf.c
src/conf/nwfilter_params.c
src/conf/object_event.c
src/conf/secret_conf.c
src/conf/snapshot_conf.c
src/conf/storage_conf.c
src/conf/storage_encryption_conf.c
src/conf/storage_source_conf.c
src/conf/virdomaincheckpointobjlist.c
src/conf/virdomainmomentobjlist.c
src/conf/virdomainsnapshotobjlist.c
src/conf/virnetworkportdef.c
src/conf/virnwfilterbindingdef.c
src/conf/virnwfilterobj.c