aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2015-04-28 11:01:02 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-03 14:26:46 (GMT)
commit74197e0adf4c63ba5551ed7e816f7d61e74a36b1 (patch)
tree05f1e349378a6e67f18cd00a469a731422608422 /wpa_supplicant/wpa_cli.c
parent2380d80493f414b7958a8a410ebf198686b73ede (diff)
downloadhostap-74197e0adf4c63ba5551ed7e816f7d61e74a36b1.zip
hostap-74197e0adf4c63ba5551ed7e816f7d61e74a36b1.tar.gz
hostap-74197e0adf4c63ba5551ed7e816f7d61e74a36b1.tar.bz2
wpa_cli: Fix memory leak when tracking networks
Fix memory leak introduced in commit 32a097fdd26b9401fbd22054a2a01ba2d71f139a ("wpa_cli: Keep track of available networks") by tracking networks only when in interactive mode. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 54777d2..bd5846b 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1456,7 +1456,8 @@ static int wpa_cli_cmd_add_network(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
int res = wpa_ctrl_command(ctrl, "ADD_NETWORK");
- update_networks(ctrl);
+ if (interactive)
+ update_networks(ctrl);
return res;
}
@@ -1465,7 +1466,8 @@ static int wpa_cli_cmd_remove_network(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
int res = wpa_cli_cmd(ctrl, "REMOVE_NETWORK", 1, argc, argv);
- update_networks(ctrl);
+ if (interactive)
+ update_networks(ctrl);
return res;
}