mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Remove some code
This commit removes the contribution of a user that we cannot trace to gain their consent for the licence change. I also cleaned up the return/error-return flow a bit. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/5811)
This commit is contained in:
parent
a73d990e2b
commit
6714cb1462
@ -610,6 +610,7 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
|
||||
unsigned char *buf = NULL;
|
||||
EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();
|
||||
int reason = ERR_R_BUF_LIB;
|
||||
int retval = 0;
|
||||
|
||||
if (ctx == NULL) {
|
||||
reason = ERR_R_MALLOC_FAILURE;
|
||||
@ -654,14 +655,14 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
|
||||
(BIO_write(bp, name, nlen) != nlen) ||
|
||||
(BIO_write(bp, "-----\n", 6) != 6))
|
||||
goto err;
|
||||
OPENSSL_clear_free(buf, PEM_BUFSIZE * 8);
|
||||
EVP_ENCODE_CTX_free(ctx);
|
||||
return i + outl;
|
||||
retval = i + outl;
|
||||
|
||||
err:
|
||||
OPENSSL_clear_free(buf, PEM_BUFSIZE * 8);
|
||||
if (retval == 0)
|
||||
PEMerr(PEM_F_PEM_WRITE_BIO, reason);
|
||||
EVP_ENCODE_CTX_free(ctx);
|
||||
PEMerr(PEM_F_PEM_WRITE_BIO, reason);
|
||||
return 0;
|
||||
OPENSSL_free(buf);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
|
Loading…
Reference in New Issue
Block a user