From: Simon McVittie Date: Tue, 21 Nov 2017 14:46:06 +0000 (+0000) Subject: dbus-nonce: Don't crash on encountering OOM X-Git-Tag: dbus-1.13.0~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9aef9b378b05f5a7f0ce55b89684990d5447df8;p=thirdparty%2Fdbus.git dbus-nonce: Don't crash on encountering OOM Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104 --- diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c index 146099f4a..b56116b32 100644 --- a/dbus/dbus-nonce.c +++ b/dbus/dbus-nonce.c @@ -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() */