projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71d5283
)
write_private_key(): Use zalloc_or_die()
author
Fabian Keil
<fk@fabiankeil.de>
Tue, 26 Nov 2019 12:01:22 +0000
(13:01 +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
b239a29
..
d64f608
100644
(file)
--- a/
ssl.c
+++ b/
ssl.c
@@
-1032,15
+1032,7
@@
static int write_private_key(mbedtls_pk_context *key, unsigned char **ret_buf,
memset(err_buf, 0, sizeof(err_buf));
/* Initializing buffer for key file content */
memset(err_buf, 0, sizeof(err_buf));
/* Initializing buffer for key file content */
- *ret_buf = (unsigned char *)malloc(PRIVATE_KEY_BUF_SIZE + 1);
- if (*ret_buf == NULL)
- {
- log_error(LOG_LEVEL_ERROR,
- "Creating buffer for private key failed: malloc fail");
- ret = -1;
- goto exit;
- }
- memset(*ret_buf, 0, PRIVATE_KEY_BUF_SIZE + 1);
+ *ret_buf = zalloc_or_die(PRIVATE_KEY_BUF_SIZE + 1);
/*
* Writing private key into PEM string
/*
* Writing private key into PEM string