diff options
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pvkfmt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index 05a79e6944..3a27f2d7fc 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -759,7 +759,7 @@ static int i2b_PVK(unsigned char **out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, void *u) { int outlen = 24, pklen; - unsigned char *p = NULL, *salt = NULL; + unsigned char *p = NULL, *start = NULL, *salt = NULL; EVP_CIPHER_CTX *cctx = NULL; if (enclevel) outlen += PVK_SALTLEN; @@ -772,7 +772,7 @@ static int i2b_PVK(unsigned char **out, EVP_PKEY *pk, int enclevel, if (*out != NULL) { p = *out; } else { - p = OPENSSL_malloc(outlen); + start = p = OPENSSL_malloc(outlen); if (p == NULL) { PEMerr(PEM_F_I2B_PVK, ERR_R_MALLOC_FAILURE); return -1; @@ -829,14 +829,14 @@ static int i2b_PVK(unsigned char **out, EVP_PKEY *pk, int enclevel, EVP_CIPHER_CTX_free(cctx); if (*out == NULL) - *out = p; + *out = start; return outlen; error: EVP_CIPHER_CTX_free(cctx); if (*out == NULL) - OPENSSL_free(p); + OPENSSL_free(start); return -1; } |