From 1787871a6627cc1a49ce7ceea8133b394ea7f486 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 13 May 2024 19:26:11 +0200 Subject: [PATCH] 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 --- usr.sbin/bhyve/bhyverun.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index d199c32cc54b..aca770a92642 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -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); }