mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-19 13:50:39 +01:00
Don't crash when reloading if we haven't loaded user database yet
The user database is populated on-demand, but the cache dropping code assumed it had been initialized. Simply check for NULL. https://bugs.freedesktop.org/show_bug.cgi?id=26182
This commit is contained in:
parent
e59db9df47
commit
0607bdb676
1 changed files with 4 additions and 2 deletions
|
|
@ -226,7 +226,8 @@ static DBusString process_homedir;
|
|||
static void
|
||||
shutdown_system_db (void *data)
|
||||
{
|
||||
_dbus_user_database_unref (system_db);
|
||||
if (system_db != NULL)
|
||||
_dbus_user_database_unref (system_db);
|
||||
system_db = NULL;
|
||||
_dbus_string_free (&process_username);
|
||||
_dbus_string_free (&process_homedir);
|
||||
|
|
@ -345,7 +346,8 @@ _dbus_user_database_flush_system (void)
|
|||
{
|
||||
_dbus_user_database_lock_system ();
|
||||
|
||||
_dbus_user_database_flush (system_db);
|
||||
if (system_db != NULL)
|
||||
_dbus_user_database_flush (system_db);
|
||||
|
||||
_dbus_user_database_unlock_system ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue