dbus_message_append_args_valist: Don't leak memory on inappropriate type 21/199021/1
authorSimon McVittie <smcv@collabora.com>
Tue, 4 Jul 2017 12:31:38 +0000 (13:31 +0100)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Fri, 1 Feb 2019 01:21:17 +0000 (10:21 +0900)
Found by source code inspection while trying to debug an unrelated
leak.

Change-Id: I0726c57bb4b0ccdadee2263b14f9fe3fe4ebc99a
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568

dbus/dbus-message.c

index 67665a1..18388a1 100644 (file)
@@ -2039,6 +2039,7 @@ dbus_message_append_args_valist (DBusMessage *message,
               _dbus_warn ("arrays of %s can't be appended with %s for now\n",
                           _dbus_type_to_string (element_type),
                           _DBUS_FUNCTION_NAME);
+              dbus_message_iter_abandon_container (&iter, &array);
               goto failed;
             }