aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/objects
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/objects')
-rw-r--r--crypto/objects/o_names.c10
-rw-r--r--crypto/objects/obj_dat.c24
-rw-r--r--crypto/objects/obj_lib.c12
3 files changed, 23 insertions, 23 deletions
diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c
index 67cb7f1837..aa82a8a07c 100644
--- a/crypto/objects/o_names.c
+++ b/crypto/objects/o_names.c
@@ -90,7 +90,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(),
for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
{
MemCheck_off();
- name_funcs = Malloc(sizeof(NAME_FUNCS));
+ name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
name_funcs->hash_func = lh_strhash;
name_funcs->cmp_func = (int (*)())strcmp;
name_funcs->free_func = 0; /* NULL is often declared to
@@ -187,7 +187,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
alias=type&OBJ_NAME_ALIAS;
type&= ~OBJ_NAME_ALIAS;
- onp=(OBJ_NAME *)Malloc(sizeof(OBJ_NAME));
+ onp=(OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
if (onp == NULL)
{
/* ERROR */
@@ -212,7 +212,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
->free_func(ret->name,ret->type,ret->data);
}
- Free(ret);
+ OPENSSL_free(ret);
}
else
{
@@ -247,7 +247,7 @@ int OBJ_NAME_remove(const char *name, int type)
sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
->free_func(ret->name,ret->type,ret->data);
}
- Free(ret);
+ OPENSSL_free(ret);
return(1);
}
else
@@ -269,7 +269,7 @@ static void names_lh_free(OBJ_NAME *onp, int type)
static void name_funcs_free(NAME_FUNCS *ptr)
{
- Free(ptr);
+ OPENSSL_free(ptr);
}
void OBJ_NAME_cleanup(int type)
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index da6df3762a..018ad5ef97 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -188,7 +188,7 @@ static void cleanup3(ADDED_OBJ *a)
{
if (--a->obj->nid == 0)
ASN1_OBJECT_free(a->obj);
- Free(a);
+ OPENSSL_free(a);
}
void OBJ_cleanup(void)
@@ -220,13 +220,13 @@ int OBJ_add_object(ASN1_OBJECT *obj)
if (added == NULL)
if (!init_added()) return(0);
if ((o=OBJ_dup(obj)) == NULL) goto err;
- ao[ADDED_NID]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
+ ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
if ((o->length != 0) && (obj->data != NULL))
- ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
+ ao[ADDED_DATA]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
if (o->sn != NULL)
- ao[ADDED_SNAME]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
+ ao[ADDED_SNAME]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
if (o->ln != NULL)
- ao[ADDED_LNAME]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ));
+ ao[ADDED_LNAME]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
for (i=ADDED_DATA; i<=ADDED_NID; i++)
{
@@ -237,7 +237,7 @@ int OBJ_add_object(ASN1_OBJECT *obj)
aop=(ADDED_OBJ *)lh_insert(added,ao[i]);
/* memory leak, buit should not normally matter */
if (aop != NULL)
- Free(aop);
+ OPENSSL_free(aop);
}
}
o->flags&= ~(ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|
@@ -246,8 +246,8 @@ int OBJ_add_object(ASN1_OBJECT *obj)
return(o->nid);
err:
for (i=ADDED_DATA; i<=ADDED_NID; i++)
- if (ao[i] != NULL) Free(ao[i]);
- if (o != NULL) Free(o);
+ if (ao[i] != NULL) OPENSSL_free(ao[i]);
+ if (o != NULL) OPENSSL_free(o);
return(NID_undef);
}
@@ -400,7 +400,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
/* Work out total size */
j = ASN1_object_size(0,i,V_ASN1_OBJECT);
- if((buf=(unsigned char *)Malloc(j)) == NULL) return NULL;
+ if((buf=(unsigned char *)OPENSSL_malloc(j)) == NULL) return NULL;
p = buf;
/* Write out tag+length */
@@ -410,7 +410,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
p=buf;
op=d2i_ASN1_OBJECT(NULL,&p,i);
- Free(buf);
+ OPENSSL_free(buf);
return op;
}
@@ -631,7 +631,7 @@ int OBJ_create(char *oid, char *sn, char *ln)
i=a2d_ASN1_OBJECT(NULL,0,oid,-1);
if (i <= 0) return(0);
- if ((buf=(unsigned char *)Malloc(i)) == NULL)
+ if ((buf=(unsigned char *)OPENSSL_malloc(i)) == NULL)
{
OBJerr(OBJ_F_OBJ_CREATE,OBJ_R_MALLOC_FAILURE);
return(0);
@@ -643,7 +643,7 @@ int OBJ_create(char *oid, char *sn, char *ln)
ok=OBJ_add_object(op);
err:
ASN1_OBJECT_free(op);
- Free(buf);
+ OPENSSL_free(buf);
return(ok);
}
diff --git a/crypto/objects/obj_lib.c b/crypto/objects/obj_lib.c
index 1a1ba0fc06..0c71639eba 100644
--- a/crypto/objects/obj_lib.c
+++ b/crypto/objects/obj_lib.c
@@ -78,7 +78,7 @@ ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
return(NULL);
}
- r->data=Malloc(o->length);
+ r->data=OPENSSL_malloc(o->length);
if (r->data == NULL)
goto err;
memcpy(r->data,o->data,o->length);
@@ -88,7 +88,7 @@ ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
if (o->ln != NULL)
{
i=strlen(o->ln)+1;
- r->ln=ln=Malloc(i);
+ r->ln=ln=OPENSSL_malloc(i);
if (r->ln == NULL) goto err;
memcpy(ln,o->ln,i);
}
@@ -98,7 +98,7 @@ ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
char *s;
i=strlen(o->sn)+1;
- r->sn=s=Malloc(i);
+ r->sn=s=OPENSSL_malloc(i);
if (r->sn == NULL) goto err;
memcpy(s,o->sn,i);
}
@@ -109,9 +109,9 @@ err:
OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE);
if (r != NULL)
{
- if (ln != NULL) Free(ln);
- if (r->data != NULL) Free(r->data);
- Free(r);
+ if (ln != NULL) OPENSSL_free(ln);
+ if (r->data != NULL) OPENSSL_free(r->data);
+ OPENSSL_free(r);
}
return(NULL);
}