Skip to content

Conversation

bleeqer
Copy link
Contributor

@bleeqer bleeqer commented Sep 29, 2025

TS_CONF_set_policies() allocated ASN1_OBJECTs via OBJ_txt2obj()
but did not free them after calling TS_RESP_CTX_add_policy().
Since TS_RESP_CTX_add_policy() duplicates the object internally,
the temporary ASN1_OBJECT must always be freed.

This patch ensures ASN1_OBJECT_free() is called on both success
and failure paths, preventing a per-policy memory leak.

Fixes #28628

@openssl-machine openssl-machine added the hold: cla required The contributor needs to submit a license agreement label Sep 29, 2025
@bleeqer bleeqer force-pushed the fix-ts-conf-policies-leak branch from 3c6358f to b5b7f92 Compare September 29, 2025 00:51
@bleeqer
Copy link
Contributor Author

bleeqer commented Sep 29, 2025

I’ve signed the CLA with this email (bleeqtheproducer@gmail.com). Please re-run the check.

Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAs are processed manually, so can take a little while.

Copy link
Contributor

@jogme jogme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@t8m t8m closed this Sep 29, 2025
@t8m t8m reopened this Sep 29, 2025
@openssl-machine openssl-machine removed the hold: cla required The contributor needs to submit a license agreement label Sep 29, 2025
@t8m t8m added approval: done This pull request has the required number of approvals branch: master Merge to master branch triaged: bug The issue/pr is/fixes a bug branch: 3.0 Merge to openssl-3.0 branch tests: exempted The PR is exempt from requirements for testing branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 branch: 3.4 Merge to openssl-3.4 branch: 3.5 Merge to openssl-3.5 branch: 3.6 Merge to openssl-3.6 labels Sep 29, 2025
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Sep 30, 2025
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)

(cherry picked from commit 1f3a660)
openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)

(cherry picked from commit 1f3a660)
openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)
openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)

(cherry picked from commit 1f3a660)
@t8m
Copy link
Member

t8m commented Oct 1, 2025

Merged to all the active branches. Thank you for your contribution.

@t8m t8m closed this Oct 1, 2025
openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)

(cherry picked from commit 1f3a660)
openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)

(cherry picked from commit 1f3a660)
openssl-machine pushed a commit that referenced this pull request Oct 1, 2025
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #28686)

(cherry picked from commit 1f3a660)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 branch: 3.4 Merge to openssl-3.4 branch: 3.5 Merge to openssl-3.5 branch: 3.6 Merge to openssl-3.6 tests: exempted The PR is exempt from requirements for testing triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Leak in TS_CONF_set_policies
5 participants