[PATCH 8/8] vpn: Fix mem leak of gid_list in task setup

Jussi Laakkonen <[email protected]> Thu, 10 Apr 2025 18:58:46 +0300
Newsgroups dev.linux.lists.connman
Message-ID <[email protected]>
Fix mem leak reported by Clang analyzer.
---
 vpn/plugins/vpn.c | 3 ++-
 1 file changed, 2 insertions(+)

diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index fc2a0e74..1644e16d 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -506,6 +506,8 @@ static void vpn_task_setup(gpointer user_data)
 	/* Change user for the task if set, requires CAP_SETUID */
 	if (uid > 0 && setuid(uid))
 		connman_error("error setting uid %d %s", uid, strerror(errno));
+
+	g_free(gid_list);
 }


--
2.39.5