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

Fix static analyzer possible leak #6894

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

julek-wolfssl
Copy link
Member

crl would never be null there but clean up code to make sure newcrl->crlLock gets free'd

crl would never be null there but clean up code to make sure newcrl->crlLock gets free'd
@julek-wolfssl julek-wolfssl self-assigned this Oct 19, 2023
@julek-wolfssl
Copy link
Member Author

Retest this please

ret = DupX509_CRL(crl, newcrl);
wc_UnLockRwLock(&newcrl->crlLock);
if (ret != 0) {
FreeCRL(crl, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to check crl != NULL here like the original code did?

Copy link
Contributor

Choose a reason for hiding this comment

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

FreeCRL should also check crl != NULL and return BAD_ARG_ERR or something. It will crash if NULL is passed.

Copy link
Member Author

Choose a reason for hiding this comment

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

crl will never be NULL here as its checked right after allocation. I agree that FreeCRL should be performing a check internally though.

Copy link
Contributor

@bandi13 bandi13 left a comment

Choose a reason for hiding this comment

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

I have some questions that should be addressed.

@bandi13 bandi13 merged commit 5da7efa into wolfSSL:master Oct 24, 2023
102 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.

2 participants