]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus_driver_handle_become_monitor: Don't leak zero-length array of rules
authorSimon McVittie <smcv@collabora.com>
Fri, 17 Aug 2018 14:33:10 +0000 (15:33 +0100)
committerSimon McVittie <smcv@collabora.com>
Mon, 19 Nov 2018 11:35:22 +0000 (11:35 +0000)
Only privileged users can trigger this leak, so it is not a denial of
service attack.

Signed-off-by: Simon McVittie <smcv@collabora.com>
bus/driver.c

index 8015f28ba7d1b3013fd2129283a042cf884f4f4c..9b3e43eeb5d99a595749367f4061119015a959d6 100644 (file)
@@ -2258,6 +2258,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection,
   /* Special case: a zero-length array becomes [""] */
   if (n_match_rules == 0)
     {
+      dbus_free (match_rules);
       match_rules = dbus_malloc (2 * sizeof (char *));
 
       if (match_rules == NULL)