[openssl/openssl] 12f679: crypto/x509/x509_lu.c: fix memory leak in obj_ht_f...

"'nikolapajkovsky' via openssl-commits" <[email protected]> Thu, 16 Jul 2026 23:39:36 -0700
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/openssl-4.0/[email protected]>
  Branch: refs/heads/openssl-4.0
  Home:   https://github.com/openssl/openssl
  Commit: 12f67950a7f45abce5007e212636ad5078afd846
      https://github.com/openssl/openssl/commit/12f67950a7f45abce5007e212636ad5078afd846
  Author: Nikola Pajkovsky <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M crypto/x509/x509_lu.c

  Log Message:
  -----------
  crypto/x509/x509_lu.c: fix memory leak in obj_ht_foreach_object()

when sk_X509_OBJECT_push() fails after x509_object_dup() has already
allocated the duplicate, the dup is neither stored on the destination
stack nor freed: the error path only pop_free()s the stack the dup was
never pushed onto, so it is leaked.

Fixes: 08cecb4448e9 "Add X509_STORE_get1_objects"
Fixes: https://github.com/openssl/openssl/issues/31771
Signed-off-by: Nikola Pajkovsky <[email protected]>

Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Fri Jul 17 06:36:48 2026
(Merged from https://github.com/openssl/openssl/pull/31810)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/openssl-4.0/b436ec-12f679%40github.com.