Skip to content

Conversation

@zawata
Copy link
Contributor

@zawata zawata commented Oct 17, 2022

An Alloc-Dealloc Mismatch causes undefined behavior. Kind of a minor problem but should be fixed nonetheless.

for more details
https://stackoverflow.com/a/10854437/4776273


if (!conversionResult.result) {
delete[] baton->{{ arg.name }};
// TODO free previously allocated memory
Copy link
Member

Choose a reason for hiding this comment

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

Does this still need to be handled?

Copy link
Contributor Author

@zawata zawata Nov 3, 2022

Choose a reason for hiding this comment

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

@julianmesa-gitkraken this comment came from you.

Copy link
Contributor

@julianmesa-gitkraken julianmesa-gitkraken Nov 7, 2022

Choose a reason for hiding this comment

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

Yes but I will do it in another PR. I need to store all allocated memory in a map, then if I get an error reading javascript arguments we have to release all allocated memory, then throw the error.

@zawata zawata force-pushed the fix/alloc-dealloc-mismatch branch from 42da6a6 to af08eb9 Compare November 7, 2022 17:55
@zawata zawata requested a review from ianhattendorf November 7, 2022 17:55
@zawata zawata force-pushed the fix/alloc-dealloc-mismatch branch from af08eb9 to 231f472 Compare November 26, 2025 19:14
@zawata zawata enabled auto-merge November 26, 2025 19:14
@zawata zawata merged commit 8cbf400 into nodegit:master Nov 26, 2025
17 checks passed
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.

3 participants