]> xenbits.xensource.com Git - libvirt.git/commit
src: Use g_steal_pointer() more
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 28 Jan 2022 17:06:32 +0000 (18:06 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Feb 2022 18:01:49 +0000 (19:01 +0100)
commit2c0898ff4ebe58d49d496806c000a85874cc283e
tree4664e7a15a9403f162c125d3b00928d805f56a4d
parenta7c016e4cb494a55650dafee187f3438f80eeed4
src: Use g_steal_pointer() more

There are few places where the g_steal_pointer() is open coded.
Switch them to calling the g_steal_pointer() function instead.
Generated by the following spatch:

  @ rule1 @
  expression a, b;
  @@
    <...
  - b = a;
    ... when != b
  - a = NULL;
  + b = g_steal_pointer(&a);
    ...>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
12 files changed:
src/esx/esx_vi.c
src/hyperv/hyperv_driver.c
src/hyperv/hyperv_wmi.c
src/hypervisor/virhostdev.c
src/libxl/xen_common.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_migration.c
src/storage/storage_backend_gluster.c
src/storage/storage_util.c
src/util/virfile.c
src/util/virlease.c
src/util/virnuma.c