Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

[nrf noup] zephyr: Don't use heap for WPA cli #153

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions wpa_supplicant/wpa_cli_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static DEFINE_DL_LIST(stations); /* struct cli_txt_entry */
static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
int argc, char *argv[])
{
char * buf = NULL;
char buf[CMD_BUF_LEN] = {0};
int ret = 0;
bool interactive = 0;

Expand All @@ -58,13 +58,7 @@ static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
min_args > 1 ? "s are" : " is");
return -1;
}
buf = os_zalloc(sizeof(char) * CMD_BUF_LEN);
if (!buf){
wpa_printf(MSG_ERROR, "Failed to allocate mem for command buf - %d\n",
CMD_BUF_LEN);
return -1;
}
memset(buf, '\0', CMD_BUF_LEN);

if (write_cmd(buf, CMD_BUF_LEN, cmd, argc, argv) < 0){
ret = -1;
goto out;
Expand All @@ -76,9 +70,6 @@ static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
ret = wpa_ctrl_command(ctrl, buf);

out:
if (buf)
os_free(buf);

return ret;
}

Expand Down
Loading