mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
nwfilterDriverRemoveDBusMatches: Prevent unsubscribing from null id
Allow nwfilterDriverRemoveDBusMatches to be called without nwfilterDriverInstallDBusMatches being called previously. This enables a later patch to use nwfilterDriverRemoveDBusMatches as a cleanup function safely. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
879ecd602f
commit
008162e12a
@ -77,12 +77,19 @@ static unsigned int reloadID;
|
|||||||
static void
|
static void
|
||||||
nwfilterDriverRemoveDBusMatches(void)
|
nwfilterDriverRemoveDBusMatches(void)
|
||||||
{
|
{
|
||||||
GDBusConnection *sysbus;
|
GDBusConnection *sysbus = virGDBusGetSystemBus();
|
||||||
|
|
||||||
sysbus = virGDBusGetSystemBus();
|
if (!sysbus)
|
||||||
if (sysbus) {
|
return;
|
||||||
|
|
||||||
|
if (restartID != 0) {
|
||||||
g_dbus_connection_signal_unsubscribe(sysbus, restartID);
|
g_dbus_connection_signal_unsubscribe(sysbus, restartID);
|
||||||
|
restartID = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reloadID != 0) {
|
||||||
g_dbus_connection_signal_unsubscribe(sysbus, reloadID);
|
g_dbus_connection_signal_unsubscribe(sysbus, reloadID);
|
||||||
|
reloadID = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user