aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/conf
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/conf
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/conf')
-rw-r--r--crypto/conf/conf_api.c24
-rw-r--r--crypto/conf/conf_def.c32
2 files changed, 28 insertions, 28 deletions
diff --git a/crypto/conf/conf_api.c b/crypto/conf/conf_api.c
index 29989270ab..8b6bc9accb 100644
--- a/crypto/conf/conf_api.c
+++ b/crypto/conf/conf_api.c
@@ -107,9 +107,9 @@ int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
if (v != NULL)
{
sk_CONF_VALUE_delete_ptr(ts,v);
- Free(v->name);
- Free(v->value);
- Free(v);
+ OPENSSL_free(v->name);
+ OPENSSL_free(v->value);
+ OPENSSL_free(v);
}
return 1;
}
@@ -181,7 +181,7 @@ void _CONF_free_data(CONF *conf)
{
if (conf == NULL || conf->data == NULL) return;
- conf->data->down_load=0; /* evil thing to make sure the 'Free()'
+ conf->data->down_load=0; /* evil thing to make sure the 'OPENSSL_free()'
* works as expected */
lh_doall_arg(conf->data,(void (*)())value_free_hash,conf->data);
@@ -212,13 +212,13 @@ static void value_free_stack(CONF_VALUE *a, LHASH *conf)
for (i=sk_num(sk)-1; i>=0; i--)
{
vv=(CONF_VALUE *)sk_value(sk,i);
- Free(vv->value);
- Free(vv->name);
- Free(vv);
+ OPENSSL_free(vv->value);
+ OPENSSL_free(vv->name);
+ OPENSSL_free(vv);
}
if (sk != NULL) sk_free(sk);
- Free(a->section);
- Free(a);
+ OPENSSL_free(a->section);
+ OPENSSL_free(a);
}
static unsigned long hash(CONF_VALUE *v)
@@ -256,10 +256,10 @@ CONF_VALUE *_CONF_new_section(CONF *conf, char *section)
if ((sk=sk_new_null()) == NULL)
goto err;
- if ((v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE))) == NULL)
+ if ((v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL)
goto err;
i=strlen(section)+1;
- if ((v->section=(char *)Malloc(i)) == NULL)
+ if ((v->section=(char *)OPENSSL_malloc(i)) == NULL)
goto err;
memcpy(v->section,section,i);
@@ -279,7 +279,7 @@ err:
if (!ok)
{
if (sk != NULL) sk_free(sk);
- if (v != NULL) Free(v);
+ if (v != NULL) OPENSSL_free(v);
v=NULL;
}
return(v);
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 368a31a92f..f7d088db0f 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -124,11 +124,11 @@ static CONF *def_create(CONF_METHOD *meth)
{
CONF *ret;
- ret = (CONF *)Malloc(sizeof(CONF) + sizeof(unsigned short *));
+ ret = (CONF *)OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
if (ret)
if (meth->init(ret) == 0)
{
- Free(ret);
+ OPENSSL_free(ret);
ret = NULL;
}
return ret;
@@ -162,7 +162,7 @@ static int def_destroy(CONF *conf)
{
if (def_destroy_data(conf))
{
- Free(conf);
+ OPENSSL_free(conf);
return 1;
}
return 0;
@@ -198,7 +198,7 @@ static int def_load(CONF *conf, BIO *in, long *line)
goto err;
}
- section=(char *)Malloc(10);
+ section=(char *)OPENSSL_malloc(10);
if (section == NULL)
{
CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
@@ -345,14 +345,14 @@ again:
p++;
*p='\0';
- if (!(v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE))))
+ if (!(v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))))
{
CONFerr(CONF_F_CONF_LOAD_BIO,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (psection == NULL) psection=section;
- v->name=(char *)Malloc(strlen(pname)+1);
+ v->name=(char *)OPENSSL_malloc(strlen(pname)+1);
v->value=NULL;
if (v->name == NULL)
{
@@ -400,29 +400,29 @@ again:
if (vv != NULL)
{
sk_CONF_VALUE_delete_ptr(ts,vv);
- Free(vv->name);
- Free(vv->value);
- Free(vv);
+ OPENSSL_free(vv->name);
+ OPENSSL_free(vv->value);
+ OPENSSL_free(vv);
}
#endif
v=NULL;
}
}
if (buff != NULL) BUF_MEM_free(buff);
- if (section != NULL) Free(section);
+ if (section != NULL) OPENSSL_free(section);
return(1);
err:
if (buff != NULL) BUF_MEM_free(buff);
- if (section != NULL) Free(section);
+ if (section != NULL) OPENSSL_free(section);
if (line != NULL) *line=eline;
sprintf(btmp,"%ld",eline);
ERR_add_error_data(2,"line ",btmp);
if ((h != conf->data) && (conf->data != NULL)) CONF_free(conf->data);
if (v != NULL)
{
- if (v->name != NULL) Free(v->name);
- if (v->value != NULL) Free(v->value);
- if (v != NULL) Free(v);
+ if (v->name != NULL) OPENSSL_free(v->name);
+ if (v->value != NULL) OPENSSL_free(v->value);
+ if (v != NULL) OPENSSL_free(v);
}
return(0);
}
@@ -602,9 +602,9 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
buf->data[to++]= *(from++);
}
buf->data[to]='\0';
- if (*pto != NULL) Free(*pto);
+ if (*pto != NULL) OPENSSL_free(*pto);
*pto=buf->data;
- Free(buf);
+ OPENSSL_free(buf);
return(1);
err:
if (buf != NULL) BUF_MEM_free(buf);