From: Tomohiro Kusumi Date: Wed, 7 Jun 2017 20:18:45 +0000 (+0300) Subject: fix wrong malloc size for ignore_error buffer X-Git-Tag: fio-2.21~17 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=685ffd575151fec5cf7733a89129a7b44660fe3a;hp=1c3fa6c92afe0b63d4ded96502393994a1085dbd fix wrong malloc size for ignore_error buffer This is supposed to be allocating the initial buffer which consists of 4 integers to store errno values to ignore. Also explicitly zero clear the buffer. Signed-off-by: Tomohiro Kusumi Signed-off-by: Jens Axboe --- diff --git a/options.c b/options.c index 2daa983e..864e7784 100644 --- a/options.c +++ b/options.c @@ -282,7 +282,7 @@ static int ignore_error_type(struct thread_data *td, int etype, char *str) } td->o.ignore_error_nr[etype] = 4; - error = malloc(4 * sizeof(struct bssplit)); + error = calloc(4, sizeof(int)); i = 0; while ((fname = strsep(&str, ":")) != NULL) {