From d51a3863f471fcce46bffb8ea06c8f2891d11e55 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Mon, 27 Apr 2020 14:56:33 -0700 Subject: [PATCH] helpers: Add check for allocation errors Forgot to add the check after calloc Signed-off-by: Otavio Pontes --- src/helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers.c b/src/helpers.c index a1b1fa7c..81a58e19 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -920,6 +920,8 @@ static void print_char(const char c, int times) char *str; str = calloc(1, times + 1); + ON_NULL_ABORT(str); + memset(str, c, times); info("%s\n", str); free(str);