Skip to content

Fix potential free of null pointer in stringlist_delete#435

Open
cruzzil wants to merge 1 commit intoesheldon:masterfrom
cruzzil:null_checks
Open

Fix potential free of null pointer in stringlist_delete#435
cruzzil wants to merge 1 commit intoesheldon:masterfrom
cruzzil:null_checks

Conversation

@cruzzil
Copy link
Copy Markdown
Contributor

@cruzzil cruzzil commented Aug 10, 2025

Closes #433

@esheldon
Copy link
Copy Markdown
Owner

esheldon commented Sep 3, 2025

If the pointer given to free is null, the function does nothing

@esheldon
Copy link
Copy Markdown
Owner

esheldon commented Sep 3, 2025

Thus the check if (slist->data != NULL) { is all that is needed, which ensures there is an array over which we can loop

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.

Perform null check before free

2 participants