Skip to content
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

Improved Memory Management Proper Resource Cleanup and Freeing Allocated Memory #804

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Shivam7-1
Copy link

This PR improves memory management by ensuring all dynamically allocated resources are properly freed. It adds early exits with cleanup for invalid parsing and URL checks, ensures out and out_get_origin are freed in all exit paths, and prevents memory leaks, enhancing the robustness and efficiency of the fuzzer code.

@Shivam7-1
Copy link
Author

Hii @anonrig Could you please Review This PR whenever you are free :)
Thanks

fuzz/ada_c.c Outdated Show resolved Hide resolved
Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

This would reduce our fuzzer coverage.

@Shivam7-1
Copy link
Author

Shivam7-1 commented Dec 21, 2024

Hii @anonrig
I had done some changes above that the fuzzer continues even if ada_parse fails or the URL is invalid, improving test coverage. Instead of returning immediately, memory is properly managed by freeing allocated resources, but the fuzzer still proceeds to test ada_can_parse and other functions.
This avoids prematurely ending tests while ensuring correct memory cleanup for invalid inputs.

@Shivam7-1 Shivam7-1 requested a review from anonrig December 21, 2024 03:19
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