mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-07 07:28:01 +02:00
dbus-nonce: Don't crash on encountering OOM
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
This commit is contained in:
parent
9ded6907e6
commit
a9aef9b378
1 changed files with 5 additions and 0 deletions
|
|
@ -301,6 +301,11 @@ do_noncefile_create (DBusNonceFile **noncefile_out,
|
|||
_dbus_assert (*noncefile_out == NULL);
|
||||
|
||||
noncefile = dbus_new0 (DBusNonceFile, 1);
|
||||
if (noncefile == NULL)
|
||||
{
|
||||
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Make it valid to "free" these even if _dbus_string_init() runs
|
||||
* out of memory: see comment in do_check_nonce() */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue