From 58ec4ec1c1d0168572f4040346814a199ecafea9 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 3 Feb 2017 17:58:31 -0600 Subject: [PATCH] wsc: Make sure the initial scan can be started In push button mode, ensure the initial scan was actually queued successfully. --- src/wsc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wsc.c b/src/wsc.c index fc2c4c0e..deb0b6ee 100644 --- a/src/wsc.c +++ b/src/wsc.c @@ -678,6 +678,13 @@ static bool wsc_start_pushbutton(struct wsc *wsc) wsc->scan_id = scan_active(device_get_ifindex(wsc->device), wsc->wsc_ies, wsc->wsc_ies_size, NULL, scan_results, wsc, NULL); + if (!wsc->scan_id) { + l_free(wsc->wsc_ies); + wsc->wsc_ies = NULL; + + return false; + } + wsc->walk_timer = l_timeout_create(WALK_TIME, walk_timeout, wsc, NULL); return true;