diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-03-04 14:29:30 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-03-05 09:44:57 +0100 |
commit | efce1e34f2956c2be7892b7f771c53cc9a657ec3 (patch) | |
tree | 68fcb114a4f1b10124a54516a788c9e43a6d6a28 /clients/common/nm-secret-agent-simple.c | |
parent | 72f40fc42153f16758fcdfa704141220d3341547 (diff) | |
download | NetworkManager-efce1e34f2956c2be7892b7f771c53cc9a657ec3.tar.gz |
clients: fix keyfile string memory leak
The return value of g_key_file_get_string() was leaked.
Fixes: 5a0d67f739052512297af8e21273af4a7b355213
(cherry picked from commit 082ae508a0640ab7bf68f89fb6786653def6ef2c)
Diffstat (limited to 'clients/common/nm-secret-agent-simple.c')
-rw-r--r-- | clients/common/nm-secret-agent-simple.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 18be0c6735..59e4c5a7b5 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -600,12 +600,15 @@ _auth_dialog_exited (GPid pid, int status, gpointer user_data) goto out; for (i = 1; groups[i]; i++) { + gs_free char *pretty_name = NULL; + if (!g_key_file_get_boolean (keyfile, groups[i], "IsSecret", NULL)) continue; if (!g_key_file_get_boolean (keyfile, groups[i], "ShouldAsk", NULL)) continue; - g_ptr_array_add (secrets, _secret_real_new_vpn_secret (g_key_file_get_string (keyfile, groups[i], "Label", NULL), + pretty_name = g_key_file_get_string (keyfile, groups[i], "Label", NULL); + g_ptr_array_add (secrets, _secret_real_new_vpn_secret (pretty_name, NM_SETTING (s_vpn), groups[i], nm_setting_vpn_get_service_type (s_vpn))); |