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:
18
ssl/s2_lib.c
18
ssl/s2_lib.c
@@ -267,12 +267,12 @@ int ssl2_new(SSL *s)
|
||||
{
|
||||
SSL2_STATE *s2;
|
||||
|
||||
if ((s2=Malloc(sizeof *s2)) == NULL) goto err;
|
||||
if ((s2=OPENSSL_malloc(sizeof *s2)) == NULL) goto err;
|
||||
memset(s2,0,sizeof *s2);
|
||||
|
||||
if ((s2->rbuf=Malloc(
|
||||
if ((s2->rbuf=OPENSSL_malloc(
|
||||
SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER+2)) == NULL) goto err;
|
||||
if ((s2->wbuf=Malloc(
|
||||
if ((s2->wbuf=OPENSSL_malloc(
|
||||
SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER+2)) == NULL) goto err;
|
||||
s->s2=s2;
|
||||
|
||||
@@ -281,9 +281,9 @@ int ssl2_new(SSL *s)
|
||||
err:
|
||||
if (s2 != NULL)
|
||||
{
|
||||
if (s2->wbuf != NULL) Free(s2->wbuf);
|
||||
if (s2->rbuf != NULL) Free(s2->rbuf);
|
||||
Free(s2);
|
||||
if (s2->wbuf != NULL) OPENSSL_free(s2->wbuf);
|
||||
if (s2->rbuf != NULL) OPENSSL_free(s2->rbuf);
|
||||
OPENSSL_free(s2);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -296,10 +296,10 @@ void ssl2_free(SSL *s)
|
||||
return;
|
||||
|
||||
s2=s->s2;
|
||||
if (s2->rbuf != NULL) Free(s2->rbuf);
|
||||
if (s2->wbuf != NULL) Free(s2->wbuf);
|
||||
if (s2->rbuf != NULL) OPENSSL_free(s2->rbuf);
|
||||
if (s2->wbuf != NULL) OPENSSL_free(s2->wbuf);
|
||||
memset(s2,0,sizeof *s2);
|
||||
Free(s2);
|
||||
OPENSSL_free(s2);
|
||||
s->s2=NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user