summaryrefslogtreecommitdiff
path: root/crypto/txt_db
diff options
context:
space:
mode:
authorlevitte <levitte>2000-06-01 22:15:51 +0000
committerlevitte <levitte>2000-06-01 22:15:51 +0000
commit1f556362dc4aa3ae4ad87da38941d9d16aa54e6d (patch)
tree58b5e41eccc7fb90b0ada59d67f6d48b06e1428e /crypto/txt_db
parentd9e0a6ac77a46f743679baada0022ce4c830db10 (diff)
downloadopenssl-1f556362dc4aa3ae4ad87da38941d9d16aa54e6d.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/txt_db')
-rw-r--r--crypto/txt_db/txt_db.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c
index 33acc81f3..3b04fe280 100644
--- a/crypto/txt_db/txt_db.c
+++ b/crypto/txt_db/txt_db.c
@@ -83,16 +83,16 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
if ((buf=BUF_MEM_new()) == NULL) goto err;
if (!BUF_MEM_grow(buf,size)) goto err;
- if ((ret=(TXT_DB *)Malloc(sizeof(TXT_DB))) == NULL)
+ if ((ret=(TXT_DB *)OPENSSL_malloc(sizeof(TXT_DB))) == NULL)
goto err;
ret->num_fields=num;
ret->index=NULL;
ret->qual=NULL;
if ((ret->data=sk_new_null()) == NULL)
goto err;
- if ((ret->index=(LHASH **)Malloc(sizeof(LHASH *)*num)) == NULL)
+ if ((ret->index=(LHASH **)OPENSSL_malloc(sizeof(LHASH *)*num)) == NULL)
goto err;
- if ((ret->qual=(int (**)())Malloc(sizeof(int (**)())*num)) == NULL)
+ if ((ret->qual=(int (**)())OPENSSL_malloc(sizeof(int (**)())*num)) == NULL)
goto err;
for (i=0; i<num; i++)
{
@@ -122,7 +122,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
else
{
buf->data[offset-1]='\0'; /* blat the '\n' */
- p=(char *)Malloc(add+offset);
+ p=(char *)OPENSSL_malloc(add+offset);
offset=0;
}
pp=(char **)p;
@@ -177,12 +177,12 @@ err:
if (er)
{
#if !defined(NO_STDIO) && !defined(WIN16)
- if (er == 1) fprintf(stderr,"Malloc failure\n");
+ if (er == 1) fprintf(stderr,"OPENSSL_malloc failure\n");
#endif
if (ret->data != NULL) sk_free(ret->data);
- if (ret->index != NULL) Free(ret->index);
- if (ret->qual != NULL) Free(ret->qual);
- if (ret != NULL) Free(ret);
+ if (ret->index != NULL) OPENSSL_free(ret->index);
+ if (ret->qual != NULL) OPENSSL_free(ret->qual);
+ if (ret != NULL) OPENSSL_free(ret);
return(NULL);
}
else
@@ -349,10 +349,10 @@ void TXT_DB_free(TXT_DB *db)
{
for (i=db->num_fields-1; i>=0; i--)
if (db->index[i] != NULL) lh_free(db->index[i]);
- Free(db->index);
+ OPENSSL_free(db->index);
}
if (db->qual != NULL)
- Free(db->qual);
+ OPENSSL_free(db->qual);
if (db->data != NULL)
{
for (i=sk_num(db->data)-1; i>=0; i--)
@@ -364,7 +364,7 @@ void TXT_DB_free(TXT_DB *db)
if (max == NULL) /* new row */
{
for (n=0; n<db->num_fields; n++)
- if (p[n] != NULL) Free(p[n]);
+ if (p[n] != NULL) OPENSSL_free(p[n]);
}
else
{
@@ -372,12 +372,12 @@ void TXT_DB_free(TXT_DB *db)
{
if (((p[n] < (char *)p) || (p[n] > max))
&& (p[n] != NULL))
- Free(p[n]);
+ OPENSSL_free(p[n]);
}
}
- Free(sk_value(db->data,i));
+ OPENSSL_free(sk_value(db->data,i));
}
sk_free(db->data);
}
- Free(db);
+ OPENSSL_free(db);
}