[openssl/openssl] 64f09b: crypto/x509/x509_lu.c: fix memory leak in obj_ht_f...

"'nikolapajkovsky' via openssl-commits" <[email protected]> Tue, 07 Jul 2026 00:46:34 -0700
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 64f09bd826e8fdefae67aea68ec1bfacefa1d5f4
      https://github.com/openssl/openssl/commit/64f09bd826e8fdefae67aea68ec1bfacefa1d5f4
  Author: Nikola Pajkovsky <[email protected]>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    M crypto/x509/x509_lu.c
    M test/recipes/60-test_x509_load_cert_file.t
    M test/x509_load_cert_file_test.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.

Set env ASAN_OPTIONS in test explicitly to detect_leaks=1 to force
ASAN to fail the test. Otherwise, the test reports ok even with valid
leak.

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

Reviewed-by: Norbert Pocs <[email protected]>
Reviewed-by: Bob Beck <[email protected]>
MergeDate: Tue Jul  7 07:42:17 2026
(Merged from https://github.com/openssl/openssl/pull/31784)



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/master/a89400-64f09b%40github.com.