fix wrong malloc size for ignore_error buffer
authorTomohiro Kusumi <tkusumi@tuxera.com>
Wed, 7 Jun 2017 20:18:45 +0000 (23:18 +0300)
committerJens Axboe <axboe@fb.com>
Wed, 7 Jun 2017 20:23:26 +0000 (14:23 -0600)
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 <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
options.c

index 2daa983e0d9b2ef1002bd10ed6156fe8e5ba486f..864e778434f4538de62fd4746456b7f9b1094281 100644 (file)
--- 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) {