From: Sviatoslav Chagaev Date: Mon, 16 Sep 2013 11:43:40 +0000 (+0100) Subject: Fix an incorrect sizeof. X-Git-Tag: dbus-1.7.6~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=990fd63f4ef5453ccfca54363cff0fa1d8547007;p=thirdparty%2Fdbus.git Fix an incorrect sizeof. Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie --- diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c index a4b547820..7382f4bf1 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); if (filters[j] == NULL) oom ("adding a new filter"); snprintf (filters[j], filter_len, "%s,%s", EAVESDROPPING_RULE, arg);