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 a few memory leaks in libnvme #744

Merged
merged 2 commits into from
Nov 8, 2023
Merged

Conversation

maurizio-lombardi
Copy link
Contributor

Static checkers complain about memory leaks in the NBFT code.

In case of error, the "discovery" pointer should be freed.

Signed-off-by: Maurizio Lombardi <[email protected]>
If the check fails, the verify() macro executes "return -EINVAL"
without freeing the allocated memory.

Fix the bug by moving verify() before the point where we call calloc().

Signed-off-by: Maurizio Lombardi <[email protected]>
@igaw igaw merged commit eb857fb into linux-nvme:master Nov 8, 2023
14 checks passed
@igaw
Copy link
Collaborator

igaw commented Nov 8, 2023

Thanks!

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