From: Jouni Malinen Date: Mon, 28 Dec 2009 10:13:52 +0000 (+0200) Subject: Fix wpa_cli with libreadline and WPA_TRACE to use consistent alloc X-Git-Tag: hostap_0_7_1~163 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d566f4152fb45b63097a6b9cd452ca8ad8ad43ac;p=thirdparty%2Fhostap.git 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. --- diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 76e2166c8..1933140c3 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/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)) { i++; if (os_strncasecmp(cmd, text, len) == 0) - return os_strdup(cmd); + return strdup(cmd); } return NULL;