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/asn1/a_bytes.c | |
| 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/asn1/a_bytes.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/a_bytes.c | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c index 92d630cdba..8431d89edf 100644 --- a/src/lib/libcrypto/asn1/a_bytes.c +++ b/src/lib/libcrypto/asn1/a_bytes.c | |||
| @@ -101,7 +101,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, | |||
| 101 | 101 | ||
| 102 | if (len != 0) | 102 | if (len != 0) | 
| 103 | { | 103 | { | 
| 104 | s=(unsigned char *)OPENSSL_malloc((int)len+1); | 104 | s=(unsigned char *)malloc((int)len+1); | 
| 105 | if (s == NULL) | 105 | if (s == NULL) | 
| 106 | { | 106 | { | 
| 107 | i=ERR_R_MALLOC_FAILURE; | 107 | i=ERR_R_MALLOC_FAILURE; | 
| @@ -114,7 +114,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, | |||
| 114 | else | 114 | else | 
| 115 | s=NULL; | 115 | s=NULL; | 
| 116 | 116 | ||
| 117 | if (ret->data != NULL) OPENSSL_free(ret->data); | 117 | if (ret->data != NULL) free(ret->data); | 
| 118 | ret->length=(int)len; | 118 | ret->length=(int)len; | 
| 119 | ret->data=s; | 119 | ret->data=s; | 
| 120 | ret->type=tag; | 120 | ret->type=tag; | 
| @@ -209,8 +209,8 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, | |||
| 209 | { | 209 | { | 
| 210 | if ((ret->length < len) || (ret->data == NULL)) | 210 | if ((ret->length < len) || (ret->data == NULL)) | 
| 211 | { | 211 | { | 
| 212 | if (ret->data != NULL) OPENSSL_free(ret->data); | 212 | if (ret->data != NULL) free(ret->data); | 
| 213 | s=(unsigned char *)OPENSSL_malloc((int)len + 1); | 213 | s=(unsigned char *)malloc((int)len + 1); | 
| 214 | if (s == NULL) | 214 | if (s == NULL) | 
| 215 | { | 215 | { | 
| 216 | i=ERR_R_MALLOC_FAILURE; | 216 | i=ERR_R_MALLOC_FAILURE; | 
| @@ -226,7 +226,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, | |||
| 226 | else | 226 | else | 
| 227 | { | 227 | { | 
| 228 | s=NULL; | 228 | s=NULL; | 
| 229 | if (ret->data != NULL) OPENSSL_free(ret->data); | 229 | if (ret->data != NULL) free(ret->data); | 
| 230 | } | 230 | } | 
| 231 | 231 | ||
| 232 | ret->length=(int)len; | 232 | ret->length=(int)len; | 
| @@ -301,14 +301,14 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) | |||
| 301 | if (!asn1_const_Finish(c)) goto err; | 301 | if (!asn1_const_Finish(c)) goto err; | 
| 302 | 302 | ||
| 303 | a->length=num; | 303 | a->length=num; | 
| 304 | if (a->data != NULL) OPENSSL_free(a->data); | 304 | if (a->data != NULL) free(a->data); | 
| 305 | a->data=(unsigned char *)b.data; | 305 | a->data=(unsigned char *)b.data; | 
| 306 | if (os != NULL) ASN1_STRING_free(os); | 306 | if (os != NULL) ASN1_STRING_free(os); | 
| 307 | return(1); | 307 | return(1); | 
| 308 | err: | 308 | err: | 
| 309 | ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE,c->error); | 309 | ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE,c->error); | 
| 310 | if (os != NULL) ASN1_STRING_free(os); | 310 | if (os != NULL) ASN1_STRING_free(os); | 
| 311 | if (b.data != NULL) OPENSSL_free(b.data); | 311 | if (b.data != NULL) free(b.data); | 
| 312 | return(0); | 312 | return(0); | 
| 313 | } | 313 | } | 
| 314 | 314 | ||
