There have been a number of complaints from a number of sources that names
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
This commit is contained in:
@@ -183,7 +183,7 @@ SSL *SSL_new(SSL_CTX *ctx)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
s=(SSL *)Malloc(sizeof(SSL));
|
||||
s=(SSL *)OPENSSL_malloc(sizeof(SSL));
|
||||
if (s == NULL) goto err;
|
||||
memset(s,0,sizeof(SSL));
|
||||
|
||||
@@ -239,7 +239,7 @@ err:
|
||||
ssl_cert_free(s->cert);
|
||||
if (s->ctx != NULL)
|
||||
SSL_CTX_free(s->ctx); /* decrement reference count */
|
||||
Free(s);
|
||||
OPENSSL_free(s);
|
||||
}
|
||||
SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
|
||||
return(NULL);
|
||||
@@ -375,7 +375,7 @@ void SSL_free(SSL *s)
|
||||
|
||||
if (s->method != NULL) s->method->ssl_free(s);
|
||||
|
||||
Free(s);
|
||||
OPENSSL_free(s);
|
||||
}
|
||||
|
||||
void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)
|
||||
@@ -1100,7 +1100,7 @@ SSL_CTX *SSL_CTX_new(SSL_METHOD *meth)
|
||||
SSLerr(SSL_F_SSL_CTX_NEW,SSL_R_X509_VERIFICATION_SETUP_PROBLEMS);
|
||||
goto err;
|
||||
}
|
||||
ret=(SSL_CTX *)Malloc(sizeof(SSL_CTX));
|
||||
ret=(SSL_CTX *)OPENSSL_malloc(sizeof(SSL_CTX));
|
||||
if (ret == NULL)
|
||||
goto err;
|
||||
|
||||
@@ -1196,7 +1196,7 @@ err2:
|
||||
}
|
||||
|
||||
static void SSL_COMP_free(SSL_COMP *comp)
|
||||
{ Free(comp); }
|
||||
{ OPENSSL_free(comp); }
|
||||
|
||||
void SSL_CTX_free(SSL_CTX *a)
|
||||
{
|
||||
@@ -1237,7 +1237,7 @@ void SSL_CTX_free(SSL_CTX *a)
|
||||
sk_X509_pop_free(a->extra_certs,X509_free);
|
||||
if (a->comp_methods != NULL)
|
||||
sk_SSL_COMP_pop_free(a->comp_methods,SSL_COMP_free);
|
||||
Free(a);
|
||||
OPENSSL_free(a);
|
||||
}
|
||||
|
||||
void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb)
|
||||
@@ -1760,13 +1760,13 @@ void ssl_clear_cipher_ctx(SSL *s)
|
||||
if (s->enc_read_ctx != NULL)
|
||||
{
|
||||
EVP_CIPHER_CTX_cleanup(s->enc_read_ctx);
|
||||
Free(s->enc_read_ctx);
|
||||
OPENSSL_free(s->enc_read_ctx);
|
||||
s->enc_read_ctx=NULL;
|
||||
}
|
||||
if (s->enc_write_ctx != NULL)
|
||||
{
|
||||
EVP_CIPHER_CTX_cleanup(s->enc_write_ctx);
|
||||
Free(s->enc_write_ctx);
|
||||
OPENSSL_free(s->enc_write_ctx);
|
||||
s->enc_write_ctx=NULL;
|
||||
}
|
||||
if (s->expand != NULL)
|
||||
|
Reference in New Issue
Block a user