git: 1662e47d91d1 - main - nvmecontrol: Free the addrinfo list when failing to open a TCP socket

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 10 May 2024 16:41:42 UTC
The branch main has been updated by jhb:

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

commit 1662e47d91d137891b62fe64ba1370047e7b506f
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-05-10 16:06:54 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-05-10 16:13:40 +0000

    nvmecontrol: Free the addrinfo list when failing to open a TCP socket
    
    Reported by:    Coverity Scan
    CID:            1545048
    Sponsored by:   Chelsio Communications
---
 sbin/nvmecontrol/fabrics.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sbin/nvmecontrol/fabrics.c b/sbin/nvmecontrol/fabrics.c
index d93e984ee7a3..de069e3df62a 100644
--- a/sbin/nvmecontrol/fabrics.c
+++ b/sbin/nvmecontrol/fabrics.c
@@ -168,6 +168,7 @@ tcp_qpair_params(struct nvmf_qpair_params *params, int adrfam,
 		return (true);
 	}
 	warn("Failed to connect to controller at %s:%s", address, port);
+	freeaddrinfo(list);
 	return (false);
 }