From 8f0cf57c2d661bfc21c3ad0c22ab0efc7c3ef752 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 4 Apr 2011 15:44:28 +0100 Subject: [PATCH 3/5] gerror_to_dbus_error_message: guarantee to return non-NULL --- dbus/dbus-gobject.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index 8276d77..f21208e 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1501,6 +1501,12 @@ gerror_to_dbus_error_message (const DBusGObjectInfo *object_info, g_free (error_name); } } + + /* this can only fail through a programming error in dbus-glib + * (@message is bad), or OOM */ + if (reply == NULL) + g_error ("dbus_message_new_error failed: out of memory?"); + return reply; } -- 1.7.4.1