summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-message.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-message.c')
-rw-r--r--dbus/dbus-message.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 355d6310..1a112a79 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -1725,12 +1725,15 @@ dbus_message_get_args_iter (DBusMessage *message)
iter = dbus_new (DBusMessageIter, 1);
- dbus_message_ref (message);
+ if (iter != NULL)
+ {
+ dbus_message_ref (message);
+
+ iter->refcount = 1;
+ iter->message = message;
+ iter->pos = 0;
+ }
- iter->refcount = 1;
- iter->message = message;
- iter->pos = 0;
-
return iter;
}