From 69e183ce551f0e541a8a86038b3e390e91f0d7d6 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Mon, 23 Dec 2024 23:26:51 -0800 Subject: [PATCH] up x509 ref count with obj creation --- src/x509_str.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/x509_str.c b/src/x509_str.c index ce8f0e28ea..2bd801ca1a 100644 --- a/src/x509_str.c +++ b/src/x509_str.c @@ -1879,6 +1879,11 @@ WOLF_STACK_OF(WOLFSSL_X509_OBJECT)* wolfSSL_X509_STORE_get0_objects( wolfSSL_X509_OBJECT_free(obj); goto err_cleanup; } + if (wolfSSL_X509_up_ref(x509) != WOLFSSL_SUCCESS) { + WOLFSSL_MSG("wolfSSL_X509_up_ref error"); + wolfSSL_X509_OBJECT_free(obj); + goto err_cleanup; + } obj->type = WOLFSSL_X509_LU_X509; obj->data.x509 = x509; }