From f579bf8ec7713035a231884db9958cdc4ff5d7cf Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Thu, 13 Apr 2000 06:33:22 +0000 Subject: Initial import of OpenSSL 0.9.5a --- crypto/openssl/crypto/asn1/a_object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crypto/openssl/crypto/asn1/a_object.c') diff --git a/crypto/openssl/crypto/asn1/a_object.c b/crypto/openssl/crypto/asn1/a_object.c index b94b418ee89a..09d56fb66900 100644 --- a/crypto/openssl/crypto/asn1/a_object.c +++ b/crypto/openssl/crypto/asn1/a_object.c @@ -222,8 +222,8 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp, } if ((ret->data == NULL) || (ret->length < len)) { - if (ret->data != NULL) Free((char *)ret->data); - ret->data=(unsigned char *)Malloc((int)len); + if (ret->data != NULL) Free(ret->data); + ret->data=(unsigned char *)Malloc(len ? (int)len : 1); ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; if (ret->data == NULL) { i=ERR_R_MALLOC_FAILURE; goto err; } @@ -269,7 +269,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a) if (a == NULL) return; if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) { -#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause mempory leaks */ +#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */ if (a->sn != NULL) Free((void *)a->sn); if (a->ln != NULL) Free((void *)a->ln); #endif -- cgit v1.2.3