Browse Source

Fix wpa_cli with libreadline and WPA_TRACE to use consistent alloc

Need to use strdup(), not os_strdup() here since the readline/fgets
result needs to use same style for memory allocation to avoid WPA_TRACE
errors.
Jouni Malinen 15 years ago
parent
commit
d566f4152f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wpa_supplicant/wpa_cli.c

+ 1 - 1
wpa_supplicant/wpa_cli.c

@@ -1776,7 +1776,7 @@ static char * wpa_cli_cmd_gen(const char *text, int state)
 	while ((cmd = wpa_cli_commands[i].cmd)) {
 	while ((cmd = wpa_cli_commands[i].cmd)) {
 		i++;
 		i++;
 		if (os_strncasecmp(cmd, text, len) == 0)
 		if (os_strncasecmp(cmd, text, len) == 0)
-			return os_strdup(cmd);
+			return strdup(cmd);
 	}
 	}
 
 
 	return NULL;
 	return NULL;