From: Matt Caswell Date: Mon, 12 Mar 2018 15:24:29 +0000 (+0000) Subject: Free the correct type in OBJ_add_object() X-Git-Tag: OpenSSL_1_0_2o~18 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e56585e3e950e98d7014476bea8bfe71b3ff0a1f;p=oweals%2Fopenssl.git Free the correct type in OBJ_add_object() We should be using ASN1_OBJECT_free() not OPENSSL_free(). Fixes #5568 Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5599) --- diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index c43d86edfb..315afa9dbe 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -305,9 +305,8 @@ int OBJ_add_object(const ASN1_OBJECT *obj) for (i = ADDED_DATA; i <= ADDED_NID; i++) if (ao[i] != NULL) OPENSSL_free(ao[i]); - if (o != NULL) - OPENSSL_free(o); - return (NID_undef); + ASN1_OBJECT_free(o); + return NID_undef; } ASN1_OBJECT *OBJ_nid2obj(int n)