aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/pem/pem_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
committerRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
commit26a3a48d65c7464b400ec1de439994d7f0d25fed (patch)
tree91abb7d351b174e58f60e5353b731b916eaf0c5c /crypto/pem/pem_lib.c
parentde42b6a7a82be33d2976ab605e74d7bc95b71447 (diff)
downloadopenssl-26a3a48d65c7464b400ec1de439994d7f0d25fed.tar.gz
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.
Diffstat (limited to 'crypto/pem/pem_lib.c')
-rw-r--r--crypto/pem/pem_lib.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c
index b5e0a650f8..a17c3ed57f 100644
--- a/crypto/pem/pem_lib.c
+++ b/crypto/pem/pem_lib.c
@@ -242,9 +242,9 @@ char *PEM_ASN1_read_bio(char *(*d2i)(), const char *name, BIO *bp, char **x,
return(NULL);
}
if(check_pem(nm, name)) break;
- Free(nm);
- Free(header);
- Free(data);
+ OPENSSL_free(nm);
+ OPENSSL_free(header);
+ OPENSSL_free(data);
}
if (!PEM_get_EVP_CIPHER_INFO(header,&cipher)) goto err;
if (!PEM_do_header(&cipher,data,&len,cb,u)) goto err;
@@ -289,9 +289,9 @@ p8err:
if (ret == NULL)
PEMerr(PEM_F_PEM_ASN1_READ_BIO,ERR_R_ASN1_LIB);
err:
- Free(nm);
- Free(header);
- Free(data);
+ OPENSSL_free(nm);
+ OPENSSL_free(header);
+ OPENSSL_free(data);
return(ret);
}
@@ -344,7 +344,7 @@ int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x,
goto err;
}
/* dzise + 8 bytes are needed */
- data=(unsigned char *)Malloc((unsigned int)dsize+20);
+ data=(unsigned char *)OPENSSL_malloc((unsigned int)dsize+20);
if (data == NULL)
{
PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_MALLOC_FAILURE);
@@ -405,7 +405,7 @@ err:
memset((char *)&ctx,0,sizeof(ctx));
memset(buf,0,PEM_BUFSIZE);
memset(data,0,(unsigned int)dsize);
- Free(data);
+ OPENSSL_free(data);
return(ret);
}
@@ -583,7 +583,7 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
goto err;
}
- buf=(unsigned char *)Malloc(PEM_BUFSIZE*8);
+ buf=(unsigned char *)OPENSSL_malloc(PEM_BUFSIZE*8);
if (buf == NULL)
{
reason=ERR_R_MALLOC_FAILURE;
@@ -603,7 +603,7 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
}
EVP_EncodeFinal(&ctx,buf,&outl);
if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err;
- Free(buf);
+ OPENSSL_free(buf);
if ( (BIO_write(bp,"-----END ",9) != 9) ||
(BIO_write(bp,name,nlen) != nlen) ||
(BIO_write(bp,"-----\n",6) != 6))
@@ -784,9 +784,9 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,
*header=headerB->data;
*data=(unsigned char *)dataB->data;
*len=bl;
- Free(nameB);
- Free(headerB);
- Free(dataB);
+ OPENSSL_free(nameB);
+ OPENSSL_free(headerB);
+ OPENSSL_free(dataB);
return(1);
err:
BUF_MEM_free(nameB);