From 5accf42aabb94e88a02bd27858ce829cd870818b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 17 Aug 2018 15:33:10 +0100 Subject: [PATCH] bus_driver_handle_become_monitor: Don't leak zero-length array of rules Only privileged users can trigger this leak, so it is not a denial of service attack. Signed-off-by: Simon McVittie --- bus/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bus/driver.c b/bus/driver.c index 8015f28ba..9b3e43eeb 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -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) -- 2.47.3