-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jq_fuzz_execute: fix memory leak #2960
Conversation
Signed-off-by: David Korczynski <[email protected]>
// Do not free "input" as this is handled by jq_teardown. | ||
else { | ||
// Only free if input as invalid as otherwise jq_teardown | ||
// frees it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if understand it correctly: jq_parse
will always return something allocated. If valid the input argument will end up on the stack by jq_start
and freed during teardown. If invalid it needs to be freed explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's how I understand it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is invalid"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is invalid"?
Ah yes, good catch. Fixed.
Signed-off-by: David Korczynski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but maybe wait for one more approve
Signed-off-by: David Korczynski <[email protected]>
Thank you! |
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64626