mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 07:10:33 +01:00
iwd: Fix the leaks in get_agent_request_network_path
Don't request new copies of strings from g_variant_get() to avoid
leaking memory as pointed out by Thomas Haller.
Fixes: dc0e31fb70 ('iwd: Add the wifi.iwd.autoconnect setting')
This commit is contained in:
parent
e23bafe5d5
commit
5ccb8ce17a
1 changed files with 5 additions and 7 deletions
|
|
@ -1282,15 +1282,13 @@ get_agent_request_network_path(GDBusMethodInvocation *invocation)
|
|||
const char *network_path = NULL;
|
||||
|
||||
if (nm_streq(method_name, "RequestPassphrase"))
|
||||
g_variant_get(params, "(o)", &network_path);
|
||||
g_variant_get(params, "(&o)", &network_path);
|
||||
else if (nm_streq(method_name, "RequestPrivateKeyPassphrase"))
|
||||
g_variant_get(params, "(o)", &network_path);
|
||||
g_variant_get(params, "(&o)", &network_path);
|
||||
else if (nm_streq(method_name, "RequestUserNameAndPassword"))
|
||||
g_variant_get(params, "(o)", &network_path);
|
||||
else if (nm_streq(method_name, "RequestUserPassword")) {
|
||||
const char *user;
|
||||
g_variant_get(params, "(os)", &network_path, &user);
|
||||
}
|
||||
g_variant_get(params, "(&o)", &network_path);
|
||||
else if (nm_streq(method_name, "RequestUserPassword"))
|
||||
g_variant_get(params, "(&os)", &network_path, NULL);
|
||||
|
||||
return network_path;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue