diff options
author | beck <> | 2014-04-17 13:37:50 +0000 |
---|---|---|
committer | beck <> | 2014-04-17 13:37:50 +0000 |
commit | bddb7c686e3d1aeb156722adc64b6c35ae720f87 (patch) | |
tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/cryptlib.c | |
parent | ecec66222d758996a4ff2671ca5026d9ede5ef76 (diff) | |
download | openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.gz openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.bz2 openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.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/cryptlib.c')
-rw-r--r-- | src/lib/libcrypto/cryptlib.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index 2bf5def17d..dc3cc2ab02 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
@@ -211,7 +211,7 @@ CRYPTO_get_new_lockid(char *name) | |||
211 | } | 211 | } |
212 | i = sk_OPENSSL_STRING_push(app_locks, str); | 212 | i = sk_OPENSSL_STRING_push(app_locks, str); |
213 | if (!i) | 213 | if (!i) |
214 | OPENSSL_free(str); | 214 | free(str); |
215 | else | 215 | else |
216 | i += CRYPTO_NUM_LOCKS; /* gap of one :-) */ | 216 | i += CRYPTO_NUM_LOCKS; /* gap of one :-) */ |
217 | return (i); | 217 | return (i); |
@@ -242,7 +242,7 @@ CRYPTO_get_new_dynlockid(void) | |||
242 | } | 242 | } |
243 | CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); | 243 | CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK); |
244 | 244 | ||
245 | pointer = (CRYPTO_dynlock *)OPENSSL_malloc(sizeof(CRYPTO_dynlock)); | 245 | pointer = (CRYPTO_dynlock *)malloc(sizeof(CRYPTO_dynlock)); |
246 | if (pointer == NULL) { | 246 | if (pointer == NULL) { |
247 | CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE); | 247 | CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE); |
248 | return (0); | 248 | return (0); |
@@ -250,7 +250,7 @@ CRYPTO_get_new_dynlockid(void) | |||
250 | pointer->references = 1; | 250 | pointer->references = 1; |
251 | pointer->data = dynlock_create_callback(__FILE__, __LINE__); | 251 | pointer->data = dynlock_create_callback(__FILE__, __LINE__); |
252 | if (pointer->data == NULL) { | 252 | if (pointer->data == NULL) { |
253 | OPENSSL_free(pointer); | 253 | free(pointer); |
254 | CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE); | 254 | CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID, ERR_R_MALLOC_FAILURE); |
255 | return (0); | 255 | return (0); |
256 | } | 256 | } |
@@ -273,7 +273,7 @@ CRYPTO_get_new_dynlockid(void) | |||
273 | 273 | ||
274 | if (i == -1) { | 274 | if (i == -1) { |
275 | dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); | 275 | dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); |
276 | OPENSSL_free(pointer); | 276 | free(pointer); |
277 | } else | 277 | } else |
278 | i += 1; /* to avoid 0 */ | 278 | i += 1; /* to avoid 0 */ |
279 | return - i; | 279 | return - i; |
@@ -312,7 +312,7 @@ CRYPTO_destroy_dynlockid(int i) | |||
312 | 312 | ||
313 | if (pointer) { | 313 | if (pointer) { |
314 | dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); | 314 | dynlock_destroy_callback(pointer->data, __FILE__, __LINE__); |
315 | OPENSSL_free(pointer); | 315 | free(pointer); |
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||