Skip to content

fix: double free and deref after free in js.c - #839

Merged
levb merged 4 commits into
nats-io:mainfrom
wooffie:fix-jsSub_resetOrderedConsumer-NO_MEMORY-handles
Feb 18, 2025
Merged

fix: double free and deref after free in js.c#839
levb merged 4 commits into
nats-io:mainfrom
wooffie:fix-jsSub_resetOrderedConsumer-NO_MEMORY-handles

Conversation

@wooffie

@wooffie wooffie commented Feb 18, 2025

Copy link
Copy Markdown
Contributor

If we failed in natsThread_Create now we do double free for oci.

I added free on oci part for this and assigns NULL to avoid it.

@levb levb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix! I made a small suggestion that I think would make the change even smaller.

Comment thread src/js.c Outdated
Comment thread src/js.c Outdated
Comment thread src/js.c Outdated

@levb levb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@levb
levb merged commit 046912f into nats-io:main Feb 18, 2025
github-actions Bot pushed a commit that referenced this pull request Feb 18, 2025
levb pushed a commit that referenced this pull request Feb 28, 2025
* fix: double free and deref after free in js.c

* fix: double free and deref after free in js.c - refactoring

* fix: double free and deref after free in js.c - refactoring

* fix: double free and deref after free in js.c - refactoring
@levb levb removed the cherry-pick label Feb 28, 2025
@levb levb mentioned this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants