]> xenbits.xensource.com Git - libvirt.git/commit
lib: Use g_clear_pointer() more
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 28 Jan 2022 17:42:45 +0000 (18:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Feb 2022 07:42:07 +0000 (08:42 +0100)
commit87a43a907f0ad4897a28ad7c216bc70f37270b93
tree77becc044a219aed11f5522edb39fc8aa3cd66ae
parent1688d2527f1ae34d57d0b5c01fbea79e40dac7b7
lib: Use g_clear_pointer() more

This change was generated using the following spatch:

  @ rule1 @
  expression a;
  identifier f;
  @@
    <...
  - f(*a);
    ... when != a;
  - *a = NULL;
  + g_clear_pointer(a, f);
    ...>

  @ rule2 @
  expression a;
  identifier f;
  @@
    <...
  - f(a);
    ... when != a;
  - a = NULL;
  + g_clear_pointer(&a, f);
    ...>

Then, I left some of the changes out, like tools/nss/ (which
doesn't link with glib) and put back a comment in
qemuBlockJobProcessEventCompletedActiveCommit() which coccinelle
decided to remove (I have no idea why).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
100 files changed:
src/ch/ch_driver.c
src/ch/ch_process.c
src/conf/capabilities.c
src/conf/domain_conf.c
src/conf/network_conf.c
src/conf/numa_conf.c
src/conf/nwfilter_conf.c
src/conf/snapshot_conf.c
src/conf/storage_source_conf.c
src/conf/virinterfaceobj.c
src/conf/virnetworkobj.c
src/conf/virnodedeviceobj.c
src/conf/virnwfilterbindingobj.c
src/conf/virsecretobj.c
src/conf/virstorageobj.c
src/datatypes.c
src/hyperv/hyperv_wmi.c
src/interface/interface_backend_netcf.c
src/libvirt-domain.c
src/libxl/libxl_capabilities.c
src/libxl/libxl_migration.c
src/locking/lock_daemon.c
src/locking/lock_driver_lockd.c
src/logging/log_daemon.c
src/lxc/lxc_controller.c
src/lxc/lxc_domain.c
src/lxc/lxc_driver.c
src/lxc/lxc_fuse.c
src/lxc/lxc_native.c
src/lxc/lxc_process.c
src/network/bridge_driver_linux.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_driver.c
src/qemu/qemu_agent.c
src/qemu/qemu_backup.c
src/qemu/qemu_blockjob.c
src/qemu/qemu_domain.c
src/qemu/qemu_domain_address.c
src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_namespace.c
src/qemu/qemu_process.c
src/remote/remote_daemon_dispatch.c
src/remote/remote_driver.c
src/remote/remote_ssh_helper.c
src/rpc/virnetclient.c
src/rpc/virnetserverclient.c
src/rpc/virnettlscontext.c
src/secret/secret_driver.c
src/security/security_manager.c
src/security/security_selinux.c
src/storage/storage_backend_iscsi_direct.c
src/storage/storage_backend_rbd.c
src/storage/storage_util.c
src/storage_file/storage_file_probe.c
src/storage_file/storage_source.c
src/test/test_driver.c
src/util/viralloc.c
src/util/virconf.c
src/util/virerror.c
src/util/vireventglib.c
src/util/virfile.c
src/util/virfilecache.c
src/util/virgdbus.c
src/util/virmdev.c
src/util/virnetdev.c
src/util/virnetlink.c
src/util/virpci.c
src/util/virresctrl.c
src/util/virstring.c
src/util/virsysinfo.c
src/util/virtpm.c
src/vbox/vbox_XPCOMCGlue.c
src/vbox/vbox_common.c
src/vbox/vbox_snapshot_conf.c
src/vmx/vmx.c
src/vz/vz_driver.c
src/vz/vz_sdk.c
tests/commandtest.c
tests/cputest.c
tests/qemumonitortestutils.c
tests/virnetdaemontest.c
tests/virnetsockettest.c
tests/virnettlshelpers.c
tests/virpcivpdtest.c
tests/virusbtest.c
tools/virsh-domain-monitor.c
tools/virsh-domain.c
tools/virsh-interface.c
tools/virsh-network.c
tools/virsh-nodedev.c
tools/virsh-nwfilter.c
tools/virsh-pool.c
tools/virsh-secret.c
tools/virsh-snapshot.c
tools/virsh-volume.c
tools/virsh.c
tools/vsh.c