]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lib: Introduce and use g_autoptr() for virInterfaceDef
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 23 Sep 2021 12:32:24 +0000 (14:32 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Nov 2021 09:52:18 +0000 (10:52 +0100)
commitb72419f38769644196ce191d031a87583dbae9be
treec8b65f1e3fa7c089f864b84584cb684d82f81420
parent488711a6ed90bd71497f575401753ac9427ca595
lib: Introduce and use g_autoptr() for virInterfaceDef

There are a lot of places where we call virInterfaceDefFree()
explicitly. We can define autoptr cleanup macro and annotate
declarations with g_autoptr() and remove plenty of those explicit
free calls.

This also fixes a memory leak in udevInterfaceGetXMLDesc() which
called virInterfaceDefFree() only in successful path.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/conf/interface_conf.c
src/conf/interface_conf.h
src/conf/virinterfaceobj.c
src/interface/interface_backend_netcf.c
src/interface/interface_backend_udev.c
src/test/test_driver.c
tests/interfacexml2xmltest.c