diff mbox

wpa_supplicant: Fix misplaced os_free

Message ID 1391429942-4190-1-git-send-email-prashanthkumar.kr@globaledgesoft.com
State Accepted
Headers show

Commit Message

Prashanth Kumar Feb. 3, 2014, 12:19 p.m. UTC
os_free has wfd_dev_info_hex as an argument which is defined within
CONFIG_NO_STDOUT_DEBUG

Signed-hostap: Prashanth Kumar <prashanthkumar.kr@globaledgesoft.com>
---
 wpa_supplicant/p2p_supplicant.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Feb. 3, 2014, 5:37 p.m. UTC | #1
On Mon, Feb 03, 2014 at 05:49:02PM +0530, Prashanth Kumar wrote:
> os_free has wfd_dev_info_hex as an argument which is defined within
> CONFIG_NO_STDOUT_DEBUG

Thanks, applied.

> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> @@ -1684,9 +1684,12 @@ static void wpas_dev_found(void *ctx, const u8 *addr,
> -#endif /* CONFIG_NO_STDOUT_DEBUG */
>  
> +#ifdef CONFIG_WIFI_DISPLAY
>  	os_free(wfd_dev_info_hex);
> +#endif /* CONFIG_WIFI_DISPLAY */
> +
> +#endif /* CONFIG_NO_STDOUT_DEBUG */

Though, I skipped the unnecessary #ifdef CONFIG_WIFI_DISPLAY to keep
this a bit nicer to look at.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 8d6c381..2fce8c4 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1684,9 +1684,12 @@  static void wpas_dev_found(void *ctx, const u8 *addr,
 		       info->dev_capab, info->group_capab,
 		       wfd_dev_info_hex ? " wfd_dev_info=0x" : "",
 		       wfd_dev_info_hex ? wfd_dev_info_hex : "");
-#endif /* CONFIG_NO_STDOUT_DEBUG */
 
+#ifdef CONFIG_WIFI_DISPLAY
 	os_free(wfd_dev_info_hex);
+#endif /* CONFIG_WIFI_DISPLAY */
+
+#endif /* CONFIG_NO_STDOUT_DEBUG */
 
 	wpas_notify_p2p_device_found(ctx, info->p2p_device_addr, new_device);
 }