]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virGDBusBusInit: Properly check for error when looking up D-Bus address
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 6 Nov 2020 12:47:19 +0000 (13:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 6 Nov 2020 15:52:11 +0000 (16:52 +0100)
commit3113f3d81532d18fbeedebc0c7de8a0e42b771b2
treef3ce64475a95f15c06ee7231a0b55d64254ecfb0
parent7e34d9a9e076ea0bd550268ad4830f53a8466f3e
virGDBusBusInit: Properly check for error when looking up D-Bus address

The virGDBusBusInit is supposed to return a reference to
requested bus type (system/session) or, if non-shared bus is
requested then create a new bus of the type. As an argument, it
gets a double pointer to GError which is passed to all g_dbus_*()
calls which allocate it on failure. Pretty standard approach.
However, since it is a double pointer we must dereference the
first level to see if the value is NULL. IOW:

  if (*error)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/util/virgdbus.c