Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2024 17:22:44 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f38117359af1 - main - ctladm: fix resource leak
Message-ID:  <202405161722.44GHMi5w052889@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f38117359af1f6b6cb373018084cad99b22dc178

commit f38117359af1f6b6cb373018084cad99b22dc178
Author:     Pierre Pronchery <pierre@freebsdfoundation.org>
AuthorDate: 2024-05-15 18:13:52 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-16 17:22:48 +0000

    ctladm: fix resource leak
    
    The str variable in cctl_nvlist_end_element() does not get free()'d when
    converted to an integer value. (name is "trtype")
    
    Reported by:    Coverity Scan
    Coverity ID:    1545039
    Sponsored by:   The FreeBSD Foundation
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1237
---
 usr.sbin/ctladm/ctladm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c
index 0b034b21b2b1..688281238fb0 100644
--- a/usr.sbin/ctladm/ctladm.c
+++ b/usr.sbin/ctladm/ctladm.c
@@ -3920,7 +3920,6 @@ cctl_nvlist_end_element(void *user_data, const char *name)
 		str = NULL;
 	} else if (strcmp(name, "trtype") == 0) {
 		cur_conn->trtype = atoi(str);
-		str = NULL;
 	} else if (strcmp(name, "connection") == 0) {
 		nvlist->cur_conn = NULL;
 	} else if (strcmp(name, "ctlnvmflist") == 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202405161722.44GHMi5w052889>