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

bhyve: avoid resource leak #1234

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

khorben
Copy link
Contributor

@khorben khorben commented May 13, 2024

In bhyve_parse_config_option(), a string is allocated and passed to nvlist_add_string() but not free'd afterwards.

Reported by: Coverity
CID: 1544049
Sponsored by: The FreeBSD Foundation

@khorben khorben requested a review from bsdjhb as a code owner May 13, 2024 19:04
Copy link
Member

@bsdimp bsdimp left a comment

Choose a reason for hiding this comment

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

So this fits the pattern elsewhere for the set_config_value and other strndup list.
nvlists appear to be allocating / freeing the storage it needs independently.
So this looks good to me.

@bsdimp bsdimp self-assigned this May 16, 2024
@bsdimp bsdimp added the ready label May 16, 2024
llfw and others added 2 commits May 16, 2024 11:16
In bhyve_parse_config_option(), a string is allocated and passed to
nvlist_add_string() but not free'd afterwards.

Reported by:	Coverity
CID:		1544049
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: freebsd#1234
@freebsd-git freebsd-git merged commit 1787871 into freebsd:main May 16, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants