From 9d811818d9cd01869af99d394b310f67d3d17299 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Fri, 28 Sep 2012 15:41:06 +0300 Subject: [PATCH] wispr: Properly handle Agent error --- src/wispr.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wispr.c b/src/wispr.c index 879f906..7ee5188 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -567,13 +567,15 @@ static void wispr_portal_request_wispr_login(struct connman_service *service, DBG(""); - if (error != NULL && g_strcmp0(error, + if (error != NULL) { + if (g_strcmp0(error, "net.connman.Agent.Error.LaunchBrowser") == 0) { - - if (__connman_agent_request_browser(service, - wispr_portal_browser_reply_cb, - wp_context->redirect_url, - wp_context) != -EINPROGRESS) + if (__connman_agent_request_browser(service, + wispr_portal_browser_reply_cb, + wp_context->redirect_url, + wp_context) != -EINPROGRESS) + free_connman_wispr_portal_context(wp_context); + } else free_connman_wispr_portal_context(wp_context); return; -- 2.7.4