summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects/o_names.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/objects/o_names.c')
-rw-r--r--src/lib/libcrypto/objects/o_names.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c
index d9389a5e5a..dca988230e 100644
--- a/src/lib/libcrypto/objects/o_names.c
+++ b/src/lib/libcrypto/objects/o_names.c
@@ -36,8 +36,9 @@ int OBJ_NAME_init(void)
36 return(names_lh != NULL); 36 return(names_lh != NULL);
37 } 37 }
38 38
39int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(), 39int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
40 void (*free_func)()) 40 int (*cmp_func)(const void *, const void *),
41 void (*free_func)(const char *, int, const char *))
41 { 42 {
42 int ret; 43 int ret;
43 int i; 44 int i;
@@ -59,7 +60,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(),
59 for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++) 60 for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
60 { 61 {
61 MemCheck_off(); 62 MemCheck_off();
62 name_funcs = Malloc(sizeof(NAME_FUNCS)); 63 name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
63 name_funcs->hash_func = lh_strhash; 64 name_funcs->hash_func = lh_strhash;
64 name_funcs->cmp_func = (int (*)())strcmp; 65 name_funcs->cmp_func = (int (*)())strcmp;
65 name_funcs->free_func = 0; /* NULL is often declared to 66 name_funcs->free_func = 0; /* NULL is often declared to
@@ -156,7 +157,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
156 alias=type&OBJ_NAME_ALIAS; 157 alias=type&OBJ_NAME_ALIAS;
157 type&= ~OBJ_NAME_ALIAS; 158 type&= ~OBJ_NAME_ALIAS;
158 159
159 onp=(OBJ_NAME *)Malloc(sizeof(OBJ_NAME)); 160 onp=(OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
160 if (onp == NULL) 161 if (onp == NULL)
161 { 162 {
162 /* ERROR */ 163 /* ERROR */
@@ -181,7 +182,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
181 sk_NAME_FUNCS_value(name_funcs_stack,ret->type) 182 sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
182 ->free_func(ret->name,ret->type,ret->data); 183 ->free_func(ret->name,ret->type,ret->data);
183 } 184 }
184 Free(ret); 185 OPENSSL_free(ret);
185 } 186 }
186 else 187 else
187 { 188 {
@@ -216,7 +217,7 @@ int OBJ_NAME_remove(const char *name, int type)
216 sk_NAME_FUNCS_value(name_funcs_stack,ret->type) 217 sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
217 ->free_func(ret->name,ret->type,ret->data); 218 ->free_func(ret->name,ret->type,ret->data);
218 } 219 }
219 Free(ret); 220 OPENSSL_free(ret);
220 return(1); 221 return(1);
221 } 222 }
222 else 223 else
@@ -238,7 +239,7 @@ static void names_lh_free(OBJ_NAME *onp, int type)
238 239
239static void name_funcs_free(NAME_FUNCS *ptr) 240static void name_funcs_free(NAME_FUNCS *ptr)
240 { 241 {
241 Free(ptr); 242 OPENSSL_free(ptr);
242 } 243 }
243 244
244void OBJ_NAME_cleanup(int type) 245void OBJ_NAME_cleanup(int type)