projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Set error code on alloc failures
[openssl.git]
/
crypto
/
pem
/
pvkfmt.c
diff --git
a/crypto/pem/pvkfmt.c
b/crypto/pem/pvkfmt.c
index d0a423957cb308ceb4663c1872c534ca793dd0f7..72ae5ab2573b5923803d58d469b75eb9d990aa39 100644
(file)
--- a/
crypto/pem/pvkfmt.c
+++ b/
crypto/pem/pvkfmt.c
@@
-444,9
+444,10
@@
static int do_i2b(unsigned char **out, EVP_PKEY *pk, int ispub)
if (*out)
p = *out;
else {
- p = OPENSSL_malloc(outlen);
- if (p == NULL)
+ if ((p = OPENSSL_malloc(outlen)) == NULL) {
+ PEMerr(PEM_F_DO_I2B, ERR_R_MALLOC_FAILURE);
return -1;
+ }
*out = p;
noinc = 1;
}