mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 01:48:00 +02:00
Fix "out of memory" handling in _dbus_get_install_root_as_hash()
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
This commit is contained in:
parent
d9e404c03a
commit
1bbc135234
1 changed files with 10 additions and 4 deletions
|
|
@ -2945,20 +2945,26 @@ static dbus_bool_t
|
|||
_dbus_get_install_root_as_hash (DBusString *out)
|
||||
{
|
||||
DBusString install_path;
|
||||
dbus_bool_t retval = FALSE;
|
||||
_dbus_assert (out != NULL);
|
||||
|
||||
_dbus_string_init (&install_path);
|
||||
if (!_dbus_string_init (&install_path))
|
||||
return FALSE;
|
||||
|
||||
if (!_dbus_get_install_root (&install_path) ||
|
||||
_dbus_string_get_length (&install_path) == 0)
|
||||
return FALSE;
|
||||
goto out;
|
||||
|
||||
_dbus_string_tolower_ascii (&install_path, 0, _dbus_string_get_length (&install_path));
|
||||
|
||||
if (!_dbus_sha_compute (&install_path, out))
|
||||
return FALSE;
|
||||
goto out;
|
||||
|
||||
return TRUE;
|
||||
retval = TRUE;
|
||||
|
||||
out:
|
||||
_dbus_string_free (&install_path);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue