From 1c0732e48340f683e638c309e4c5f231af58d23e Mon Sep 17 00:00:00 2001 From: Peiwei Hu Date: Wed, 5 Jan 2022 23:17:53 +0800 Subject: [PATCH] Fix: some patches related to error exiting Fixes #20613 Reviewed-by: Shane Lontis Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20615) --- crypto/objects/obj_dat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index ee1ada85d16d..e8377e9fc309 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -742,16 +742,17 @@ int OBJ_create(const char *oid, const char *sn, const char *ln) if ((sn != NULL && OBJ_sn2nid(sn) != NID_undef) || (ln != NULL && OBJ_ln2nid(ln) != NID_undef)) { ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS); - goto err; + return 0; } /* Convert numerical OID string to an ASN1_OBJECT structure */ tmpoid = OBJ_txt2obj(oid, 1); if (tmpoid == NULL) - goto err; + return 0; if (!ossl_obj_write_lock(1)) { ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK); + ASN1_OBJECT_free(tmpoid); return 0; }