From a2f609e742f9f388416700257a65adcb9627bc01 Mon Sep 17 00:00:00 2001 From: Sviatoslav Chagaev Date: Fri, 13 Sep 2013 18:58:48 +0300 Subject: [PATCH 3/3] Fix an incorrect sizeof. Fix an incorrect sizeof which leads to allocation of more memory than actually needed. --- tools/dbus-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c index a4b5478..42cc508 100644 --- a/tools/dbus-monitor.c +++ b/tools/dbus-monitor.c @@ -310,7 +310,7 @@ main (int argc, char *argv[]) filters = (char **) realloc (filters, numFilters * sizeof (char *)); if (filters == NULL) oom ("adding a new filter slot"); - filters[j] = (char *) malloc (filter_len * sizeof (char *)); + filters[j] = (char *) malloc (filter_len * sizeof (char)); if (filters[j] == NULL) oom ("adding a new filter"); snprintf (filters[j], filter_len, "%s,%s", EAVESDROPPING_RULE, arg); -- 1.8.3.1