bhyve: avoid resource leak

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: https://github.com/freebsd/freebsd-src/pull/1234
This commit is contained in:
Pierre Pronchery 2024-05-13 19:26:11 +02:00 committed by Warner Losh
parent 304a03275a
commit 1787871a66

View file

@ -593,6 +593,7 @@ bhyve_parse_config_option(const char *option)
if (path == NULL)
err(4, "Failed to allocate memory");
set_config_value(path, value + 1);
free(path);
return (true);
}