mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-02 17:48:07 +02: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') (cherry picked from commit5ccb8ce17a)
This commit is contained in:
parent
8f2ca652d9
commit
210d2696a9
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