summaryrefslogtreecommitdiff
path: root/tools/dbus-monitor.c
diff options
context:
space:
mode:
authorSviatoslav Chagaev <sviatoslav.chagaev@gmail.com>2013-09-16 12:43:40 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-16 15:31:22 +0100
commit990fd63f4ef5453ccfca54363cff0fa1d8547007 (patch)
treec0c6aaaa21a05d12bf268882a1055a763378838c /tools/dbus-monitor.c
parent9577e33c89211599e735b5b054ac1d7b84fb2bd8 (diff)
downloaddbus-990fd63f4ef5453ccfca54363cff0fa1d8547007.tar.gz
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 <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'tools/dbus-monitor.c')
-rw-r--r--tools/dbus-monitor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c
index a4b54782..7382f4bf 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);