Free the correct type in OBJ_add_object()
authorMatt Caswell <matt@openssl.org>
Mon, 12 Mar 2018 15:24:29 +0000 (15:24 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 12 Mar 2018 19:52:06 +0000 (19:52 +0000)
We should be using ASN1_OBJECT_free() not OPENSSL_free().

Fixes #5568

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5598)

crypto/objects/obj_dat.c

index 53109acfea29b23e2a3d1cca349cf80609253c34..9be8a7bf985f972d3f2bd66c99a09c7b555efbea 100644 (file)
@@ -213,8 +213,8 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
  err:
     for (i = ADDED_DATA; i <= ADDED_NID; i++)
         OPENSSL_free(ao[i]);
-    OPENSSL_free(o);
-    return (NID_undef);
+    ASN1_OBJECT_free(o);
+    return NID_undef;
 }
 
 ASN1_OBJECT *OBJ_nid2obj(int n)