From 14dc0fd27b7c45cd46be3a14e617b186405ebd51 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 26 Nov 2019 13:02:18 +0100 Subject: [PATCH] make_certs_path(): Use zalloc_or_die() --- ssl.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/ssl.c b/ssl.c index d64f6082..220e099a 100644 --- a/ssl.c +++ b/ssl.c @@ -1597,13 +1597,7 @@ static char *make_certs_path(const char *conf_dir, const char *file_name, * absolute path to cwd. */ path_size += strlen(basedir) + 2; - path = (char *)malloc(path_size); - if (path == NULL) - { - log_error(LOG_LEVEL_ERROR, "make_certs_path failed: malloc fail"); - return NULL; - } - memset(path, 0, path_size); + path = zalloc_or_die(path_size); strlcpy(path, basedir, path_size); strlcat(path, delim, path_size); @@ -1615,13 +1609,7 @@ static char *make_certs_path(const char *conf_dir, const char *file_name, else #endif /* defined unix */ { - path = (char *)malloc(path_size); - if (path == NULL) - { - log_error(LOG_LEVEL_ERROR, "make_certs_path failed: malloc fail"); - return NULL; - } - memset(path, 0, path_size); + path = zalloc_or_die(path_size); strlcpy(path, conf_dir, path_size); strlcat(path, delim, path_size); -- 2.39.2