]> xenbits.xensource.com Git - libvirt.git/commit
Use g_steal_pointer where possible
authorKristina Hanicova <khanicov@redhat.com>
Tue, 23 Feb 2021 13:58:29 +0000 (14:58 +0100)
committerJán Tomko <jtomko@redhat.com>
Mon, 1 Mar 2021 14:54:42 +0000 (15:54 +0100)
commit155151a3d061e36417095f6fc09db3471a9eaa47
treeb1ff2194b572f5fe56d71db5f3352c27e7e84ec4
parentcb29e4e801dc3b4f25038233a502c784ebf1e0c5
Use g_steal_pointer where possible

Via coccinelle (not the handbag!)
spatches used:
@ rule1 @
identifier a, b;
symbol NULL;
@@

- b = a;
  ... when != a
- a = NULL;
+ b = g_steal_pointer(&a);

@@

- *b = a;
  ... when != a
- a = NULL;
+ *b = g_steal_pointer(&a);

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
21 files changed:
src/admin/admin_server.c
src/conf/capabilities.c
src/conf/netdev_bandwidth_conf.c
src/conf/virdomainobjlist.c
src/conf/virnwfilterobj.c
src/interface/interface_backend_netcf.c
src/interface/interface_backend_udev.c
src/qemu/qemu_driver.c
src/qemu/qemu_monitor_json.c
src/remote/remote_driver.c
src/rpc/virnetserver.c
src/util/virfile.c
src/util/virlog.c
src/util/virmdev.c
src/util/virsysinfo.c
src/util/virtypedparam.c
src/vbox/vbox_common.c
src/vz/vz_driver.c
tests/commandhelper.c
tools/virsh-checkpoint.c
tools/virsh-domain.c