Skip to content

Fix potential free of null pointer in stringlist_delete#435

Open
cruzzil wants to merge 1 commit into
esheldon:masterfrom
cruzzil:null_checks
Open

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

Conversation

@cruzzil

@cruzzil cruzzil commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

Closes #433

@esheldon

esheldon commented Sep 3, 2025

Copy link
Copy Markdown
Owner

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

@esheldon

esheldon commented Sep 3, 2025

Copy link
Copy Markdown
Owner

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