From: Fabian Keil Date: Tue, 26 Nov 2019 12:02:18 +0000 (+0100) Subject: make_certs_path(): Use zalloc_or_die() X-Git-Tag: v_3_0_29~551 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=14dc0fd27b7c45cd46be3a14e617b186405ebd51 make_certs_path(): Use zalloc_or_die() --- 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);