diff options
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 | ||
