aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Price <anprice@redhat.com>2014-04-26 03:49:22 +0100
committerAndrew Price <anprice@redhat.com>2014-04-26 03:49:22 +0100
commit04c78bb7014df9421357ccaffc41063944617a9b (patch)
tree75fc3a82907e98a4783b435de729c6aeb1e173d3
parent5436d38d6d834b747f72666bec3013781811d6d6 (diff)
downloadiowatcher-04c78bb7014df9421357ccaffc41063944617a9b.tar.gz
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 <anprice@redhat.com>
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 92b0ef3..ebbcf3d 100644
--- a/main.c
+++ b/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)