diff options
| author | beck <> | 2014-04-17 13:37:50 +0000 |
|---|---|---|
| committer | beck <> | 2014-04-17 13:37:50 +0000 |
| commit | 6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd (patch) | |
| tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/store | |
| parent | 4d13fb9c7b5ac7311d7031173c21ab0121388413 (diff) | |
| download | openbsd-6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd.tar.gz openbsd-6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd.tar.bz2 openbsd-6aa5f85bab6ba5f9189fbc3d53a12e0f6dae48dd.zip | |
Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free
Diffstat (limited to 'src/lib/libcrypto/store')
| -rw-r--r-- | src/lib/libcrypto/store/str_lib.c | 24 | ||||
| -rw-r--r-- | src/lib/libcrypto/store/str_mem.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/store/str_meth.c | 6 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/libcrypto/store/str_lib.c b/src/lib/libcrypto/store/str_lib.c index e92dc1f51c..a451e9cb74 100644 --- a/src/lib/libcrypto/store/str_lib.c +++ b/src/lib/libcrypto/store/str_lib.c | |||
| @@ -112,7 +112,7 @@ STORE *STORE_new_method(const STORE_METHOD *method) | |||
| 112 | return NULL; | 112 | return NULL; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | ret=(STORE *)OPENSSL_malloc(sizeof(STORE)); | 115 | ret=(STORE *)malloc(sizeof(STORE)); |
| 116 | if (ret == NULL) | 116 | if (ret == NULL) |
| 117 | { | 117 | { |
| 118 | STOREerr(STORE_F_STORE_NEW_METHOD,ERR_R_MALLOC_FAILURE); | 118 | STOREerr(STORE_F_STORE_NEW_METHOD,ERR_R_MALLOC_FAILURE); |
| @@ -185,7 +185,7 @@ void STORE_free(STORE *store) | |||
| 185 | if (store->meth->clean) | 185 | if (store->meth->clean) |
| 186 | store->meth->clean(store); | 186 | store->meth->clean(store); |
| 187 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_STORE, store, &store->ex_data); | 187 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_STORE, store, &store->ex_data); |
| 188 | OPENSSL_free(store); | 188 | free(store); |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void)) | 191 | int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void)) |
| @@ -1227,7 +1227,7 @@ int STORE_delete_arbitrary(STORE *s, OPENSSL_ITEM attributes[], | |||
| 1227 | 1227 | ||
| 1228 | STORE_OBJECT *STORE_OBJECT_new(void) | 1228 | STORE_OBJECT *STORE_OBJECT_new(void) |
| 1229 | { | 1229 | { |
| 1230 | STORE_OBJECT *object = OPENSSL_malloc(sizeof(STORE_OBJECT)); | 1230 | STORE_OBJECT *object = malloc(sizeof(STORE_OBJECT)); |
| 1231 | if (object) memset(object, 0, sizeof(STORE_OBJECT)); | 1231 | if (object) memset(object, 0, sizeof(STORE_OBJECT)); |
| 1232 | return object; | 1232 | return object; |
| 1233 | } | 1233 | } |
| @@ -1253,7 +1253,7 @@ void STORE_OBJECT_free(STORE_OBJECT *data) | |||
| 1253 | BUF_MEM_free(data->data.arbitrary); | 1253 | BUF_MEM_free(data->data.arbitrary); |
| 1254 | break; | 1254 | break; |
| 1255 | } | 1255 | } |
| 1256 | OPENSSL_free(data); | 1256 | free(data); |
| 1257 | } | 1257 | } |
| 1258 | 1258 | ||
| 1259 | IMPLEMENT_STACK_OF(STORE_OBJECT*) | 1259 | IMPLEMENT_STACK_OF(STORE_OBJECT*) |
| @@ -1280,7 +1280,7 @@ struct STORE_attr_info_st | |||
| 1280 | 1280 | ||
| 1281 | STORE_ATTR_INFO *STORE_ATTR_INFO_new(void) | 1281 | STORE_ATTR_INFO *STORE_ATTR_INFO_new(void) |
| 1282 | { | 1282 | { |
| 1283 | return (STORE_ATTR_INFO *)OPENSSL_malloc(sizeof(STORE_ATTR_INFO)); | 1283 | return (STORE_ATTR_INFO *)malloc(sizeof(STORE_ATTR_INFO)); |
| 1284 | } | 1284 | } |
| 1285 | static void STORE_ATTR_INFO_attr_free(STORE_ATTR_INFO *attrs, | 1285 | static void STORE_ATTR_INFO_attr_free(STORE_ATTR_INFO *attrs, |
| 1286 | STORE_ATTR_TYPES code) | 1286 | STORE_ATTR_TYPES code) |
| @@ -1320,7 +1320,7 @@ int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs) | |||
| 1320 | STORE_ATTR_TYPES i; | 1320 | STORE_ATTR_TYPES i; |
| 1321 | for(i = 0; i++ < STORE_ATTR_TYPE_NUM;) | 1321 | for(i = 0; i++ < STORE_ATTR_TYPE_NUM;) |
| 1322 | STORE_ATTR_INFO_attr_free(attrs, i); | 1322 | STORE_ATTR_INFO_attr_free(attrs, i); |
| 1323 | OPENSSL_free(attrs); | 1323 | free(attrs); |
| 1324 | } | 1324 | } |
| 1325 | return 1; | 1325 | return 1; |
| 1326 | } | 1326 | } |
| @@ -1474,7 +1474,7 @@ int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | |||
| 1474 | } | 1474 | } |
| 1475 | if (ATTR_IS_SET(attrs,code)) | 1475 | if (ATTR_IS_SET(attrs,code)) |
| 1476 | { | 1476 | { |
| 1477 | OPENSSL_free(attrs->values[code].cstring); | 1477 | free(attrs->values[code].cstring); |
| 1478 | attrs->values[code].cstring = NULL; | 1478 | attrs->values[code].cstring = NULL; |
| 1479 | CLEAR_ATTRBIT(attrs, code); | 1479 | CLEAR_ATTRBIT(attrs, code); |
| 1480 | } | 1480 | } |
| @@ -1491,7 +1491,7 @@ int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code | |||
| 1491 | } | 1491 | } |
| 1492 | if (ATTR_IS_SET(attrs,code)) | 1492 | if (ATTR_IS_SET(attrs,code)) |
| 1493 | { | 1493 | { |
| 1494 | OPENSSL_free(attrs->values[code].sha1string); | 1494 | free(attrs->values[code].sha1string); |
| 1495 | attrs->values[code].sha1string = NULL; | 1495 | attrs->values[code].sha1string = NULL; |
| 1496 | CLEAR_ATTRBIT(attrs, code); | 1496 | CLEAR_ATTRBIT(attrs, code); |
| 1497 | } | 1497 | } |
| @@ -1508,7 +1508,7 @@ int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | |||
| 1508 | } | 1508 | } |
| 1509 | if (ATTR_IS_SET(attrs,code)) | 1509 | if (ATTR_IS_SET(attrs,code)) |
| 1510 | { | 1510 | { |
| 1511 | OPENSSL_free(attrs->values[code].dn); | 1511 | free(attrs->values[code].dn); |
| 1512 | attrs->values[code].dn = NULL; | 1512 | attrs->values[code].dn = NULL; |
| 1513 | CLEAR_ATTRBIT(attrs, code); | 1513 | CLEAR_ATTRBIT(attrs, code); |
| 1514 | } | 1514 | } |
| @@ -1525,7 +1525,7 @@ int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, | |||
| 1525 | } | 1525 | } |
| 1526 | if (ATTR_IS_SET(attrs,code)) | 1526 | if (ATTR_IS_SET(attrs,code)) |
| 1527 | { | 1527 | { |
| 1528 | OPENSSL_free(attrs->values[code].number); | 1528 | free(attrs->values[code].number); |
| 1529 | attrs->values[code].number = NULL; | 1529 | attrs->values[code].number = NULL; |
| 1530 | CLEAR_ATTRBIT(attrs, code); | 1530 | CLEAR_ATTRBIT(attrs, code); |
| 1531 | } | 1531 | } |
| @@ -1541,7 +1541,7 @@ void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes) | |||
| 1541 | if (attributes) | 1541 | if (attributes) |
| 1542 | { | 1542 | { |
| 1543 | struct attr_list_ctx_st *context = | 1543 | struct attr_list_ctx_st *context = |
| 1544 | (struct attr_list_ctx_st *)OPENSSL_malloc(sizeof(struct attr_list_ctx_st)); | 1544 | (struct attr_list_ctx_st *)malloc(sizeof(struct attr_list_ctx_st)); |
| 1545 | if (context) | 1545 | if (context) |
| 1546 | context->attributes = attributes; | 1546 | context->attributes = attributes; |
| 1547 | else | 1547 | else |
| @@ -1650,7 +1650,7 @@ int STORE_parse_attrs_end(void *handle) | |||
| 1650 | #if 0 | 1650 | #if 0 |
| 1651 | OPENSSL_ITEM *attributes = context->attributes; | 1651 | OPENSSL_ITEM *attributes = context->attributes; |
| 1652 | #endif | 1652 | #endif |
| 1653 | OPENSSL_free(context); | 1653 | free(context); |
| 1654 | return 1; | 1654 | return 1; |
| 1655 | } | 1655 | } |
| 1656 | STOREerr(STORE_F_STORE_PARSE_ATTRS_END, ERR_R_PASSED_NULL_PARAMETER); | 1656 | STOREerr(STORE_F_STORE_PARSE_ATTRS_END, ERR_R_PASSED_NULL_PARAMETER); |
diff --git a/src/lib/libcrypto/store/str_mem.c b/src/lib/libcrypto/store/str_mem.c index 8ac4f7e55c..997e60fe93 100644 --- a/src/lib/libcrypto/store/str_mem.c +++ b/src/lib/libcrypto/store/str_mem.c | |||
| @@ -222,7 +222,7 @@ static void *mem_list_start(STORE *s, STORE_OBJECT_TYPES type, | |||
| 222 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]) | 222 | OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]) |
| 223 | { | 223 | { |
| 224 | struct mem_ctx_st *context = | 224 | struct mem_ctx_st *context = |
| 225 | (struct mem_ctx_st *)OPENSSL_malloc(sizeof(struct mem_ctx_st)); | 225 | (struct mem_ctx_st *)malloc(sizeof(struct mem_ctx_st)); |
| 226 | void *attribute_context = NULL; | 226 | void *attribute_context = NULL; |
| 227 | STORE_ATTR_INFO *attrs = NULL; | 227 | STORE_ATTR_INFO *attrs = NULL; |
| 228 | 228 | ||
| @@ -336,7 +336,7 @@ static int mem_list_end(STORE *s, void *handle) | |||
| 336 | } | 336 | } |
| 337 | if (context && context->search_attributes) | 337 | if (context && context->search_attributes) |
| 338 | sk_STORE_ATTR_INFO_free(context->search_attributes); | 338 | sk_STORE_ATTR_INFO_free(context->search_attributes); |
| 339 | if (context) OPENSSL_free(context); | 339 | if (context) free(context); |
| 340 | return 1; | 340 | return 1; |
| 341 | } | 341 | } |
| 342 | static int mem_list_endp(STORE *s, void *handle) | 342 | static int mem_list_endp(STORE *s, void *handle) |
diff --git a/src/lib/libcrypto/store/str_meth.c b/src/lib/libcrypto/store/str_meth.c index a46de03a26..8944824618 100644 --- a/src/lib/libcrypto/store/str_meth.c +++ b/src/lib/libcrypto/store/str_meth.c | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | 62 | ||
| 63 | STORE_METHOD *STORE_create_method(char *name) | 63 | STORE_METHOD *STORE_create_method(char *name) |
| 64 | { | 64 | { |
| 65 | STORE_METHOD *store_method = (STORE_METHOD *)OPENSSL_malloc(sizeof(STORE_METHOD)); | 65 | STORE_METHOD *store_method = (STORE_METHOD *)malloc(sizeof(STORE_METHOD)); |
| 66 | 66 | ||
| 67 | if (store_method) | 67 | if (store_method) |
| 68 | { | 68 | { |
| @@ -78,9 +78,9 @@ STORE_METHOD *STORE_create_method(char *name) | |||
| 78 | void STORE_destroy_method(STORE_METHOD *store_method) | 78 | void STORE_destroy_method(STORE_METHOD *store_method) |
| 79 | { | 79 | { |
| 80 | if (!store_method) return; | 80 | if (!store_method) return; |
| 81 | OPENSSL_free(store_method->name); | 81 | free(store_method->name); |
| 82 | store_method->name = NULL; | 82 | store_method->name = NULL; |
| 83 | OPENSSL_free(store_method); | 83 | free(store_method); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f) | 86 | int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f) |
