diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_object.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/a_object.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c index b94b418ee8..09d56fb669 100644 --- a/src/lib/libcrypto/asn1/a_object.c +++ b/src/lib/libcrypto/asn1/a_object.c | |||
| @@ -222,8 +222,8 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp, | |||
| 222 | } | 222 | } |
| 223 | if ((ret->data == NULL) || (ret->length < len)) | 223 | if ((ret->data == NULL) || (ret->length < len)) |
| 224 | { | 224 | { |
| 225 | if (ret->data != NULL) Free((char *)ret->data); | 225 | if (ret->data != NULL) Free(ret->data); |
| 226 | ret->data=(unsigned char *)Malloc((int)len); | 226 | ret->data=(unsigned char *)Malloc(len ? (int)len : 1); |
| 227 | ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; | 227 | ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; |
| 228 | if (ret->data == NULL) | 228 | if (ret->data == NULL) |
| 229 | { i=ERR_R_MALLOC_FAILURE; goto err; } | 229 | { i=ERR_R_MALLOC_FAILURE; goto err; } |
| @@ -269,7 +269,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a) | |||
| 269 | if (a == NULL) return; | 269 | if (a == NULL) return; |
| 270 | if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) | 270 | if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) |
| 271 | { | 271 | { |
| 272 | #ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause mempory leaks */ | 272 | #ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */ |
| 273 | if (a->sn != NULL) Free((void *)a->sn); | 273 | if (a->sn != NULL) Free((void *)a->sn); |
| 274 | if (a->ln != NULL) Free((void *)a->ln); | 274 | if (a->ln != NULL) Free((void *)a->ln); |
| 275 | #endif | 275 | #endif |
