projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
afe7083
)
make_certs_path(): Use zalloc_or_die()
author
Fabian Keil
<fk@fabiankeil.de>
Tue, 26 Nov 2019 12:02:18 +0000
(13:02 +0100)
committer
Fabian Keil
<fk@fabiankeil.de>
Wed, 27 Nov 2019 12:31:08 +0000
(13:31 +0100)
ssl.c
patch
|
blob
|
history
diff --git
a/ssl.c
b/ssl.c
index
d64f608
..
220e099
100644
(file)
--- 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;
* 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);
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 */
{
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);
strlcpy(path, conf_dir, path_size);
strlcat(path, delim, path_size);