From 7f64c1928f85235e01e6f268fdc4cbfc921b5c42 Mon Sep 17 00:00:00 2001 From: Andrew Price Date: Sat, 26 Apr 2014 03:49:22 +0100 Subject: [PATCH] iowatcher: Correct a couple of calloc calls (Caught by Coverity.) tf->gdd_writes and tf->gdd_reads are arrays of pointers so update their allocations to use the correct element size. Signed-off-by: Andrew Price --- iowatcher/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iowatcher/main.c b/iowatcher/main.c index 92b0ef3..ebbcf3d 100644 --- a/iowatcher/main.c +++ b/iowatcher/main.c @@ -287,8 +287,8 @@ static void setup_trace_file_graphs(void) tf->queue_depth_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); tf->iop_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); - tf->gdd_writes = calloc(alloc_ptrs, sizeof(struct graph_dot_data)); - tf->gdd_reads = calloc(alloc_ptrs, sizeof(struct graph_dot_data)); + tf->gdd_writes = calloc(alloc_ptrs, sizeof(struct graph_dot_data *)); + tf->gdd_reads = calloc(alloc_ptrs, sizeof(struct graph_dot_data *)); tf->io_plots_allocated = alloc_ptrs; if (tf->trace->mpstat_num_cpus == 0) -- 2.25.1