From nobody Thu May 16 17:20:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgH0c4RfLz5LZNG; Thu, 16 May 2024 17:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgH0c2jZsz4PTY; Thu, 16 May 2024 17:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715880016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8hj7v3WbrdX84ksqFMSkOefYE19dympPb0J5WpEx/g=; b=Hf534QSI6KJaYTBMDWNqrGHhGqtsF3ljbUe5TK/EvWr/tTnagroFssU9FxR3rvmdZZ+p1P WUhELPsS7VG5DdaLYFlASPNUGiX/+d/+IY6y9CWhTF5ImPczg7OsnVmwgc0gN1flzoMTH6 Ht9pWuo5ZbkzCy62YBXiAWsVkXoGU/VSxiRlA87j5ViAyxxTGtLH8RI+JdmjBU+c/vgYh5 gvYaW8bxMyoZ9H79SFkWF1+p02Zm1txyFXPpfDSTSKqY5PCGMsk3hTswaQFrifS8gIK4uj 0SUPkrfS+iamD5HJ7W0ymQINVfl1HpRkLmWHW75HytKDw6H+jKPVAp7+DzmKtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715880016; a=rsa-sha256; cv=none; b=ZboIFa2+358v6C9ArNWFvFLg/RNfguuM0UtP+TZC3b2c37jcw3I3HC2PJ+DzekmOes7ATc IxQcDQ744lHtbqy0x/wmG+C4uidKoyKvtTvp1sJuM29Dk3Xm/bzVbpHqnICv2XiZZsQlWS LhsC28cURTsV8Z9YghVFwUGBoa1BtH+MNJumQHRyAWltc9+J7vQHKdrZlhvk5DBxkqqIVN vsInf0LGcBA/kGvP7oqgZbncgEcfmrdKWhLN7TU24TvH96nTBfNBbtNRq7MU3bZRojS6k5 DtUeDCWkZl6A9x1Vhlwfs3rNDtm70SCIiBkVT5o8nP6x0APT4OqvYSi9EH3+OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715880016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8hj7v3WbrdX84ksqFMSkOefYE19dympPb0J5WpEx/g=; b=LEp4ZOs410+0VOoRKRTIgxAYU4/K/GMdavGrj3GTMRFOxc6TKAvDJOC/MJ/4n2r0byMuL0 Tgo6pG4xR/XzXjlCcxCMUKN3b2BiaGmSh8YMWXypVujO6TgdbYmVFxLmLgXxLx/3julYf8 yurjJUmCt8WUnaY1WEylfG2aFCnnh8A3xc5fzGo0cFxMqeJGQJFJOAk3h7psP4L26csuxP 6xnHM3urPBlFxhPGkv7nFR4PCyKZutWtjK7X9NUP5GGlY2otiYsacQSPTnmzehdJN6CUg/ Bcoz1k8To0jZ7I+l+BU8i9YW7FOqFTrbfSF6iWVJeIF5SVTcobfojrmuM1BzCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgH0c2Bmxz16sC; Thu, 16 May 2024 17:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44GHKGae043933; Thu, 16 May 2024 17:20:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44GHKGiO043924; Thu, 16 May 2024 17:20:16 GMT (envelope-from git) Date: Thu, 16 May 2024 17:20:16 GMT Message-Id: <202405161720.44GHKGiO043924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1787871a6627 - main - bhyve: avoid resource leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1787871a6627cc1a49ce7ceea8133b394ea7f486 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1787871a6627cc1a49ce7ceea8133b394ea7f486 commit 1787871a6627cc1a49ce7ceea8133b394ea7f486 Author: Pierre Pronchery AuthorDate: 2024-05-13 17:26:11 +0000 Commit: Warner Losh CommitDate: 2024-05-16 17:19:33 +0000 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); }