X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fwispr.c;h=3b203fba7c57244cfdd252a9a7da8ed3c6a74d53;hb=c647a4b6f1132684c9d8b8ad71ec38d81147b278;hp=62f6b8db19257084f69def87313b6e18135e4fc8;hpb=04d1dbacf6aabbb44f16f6776496192964d460d8;p=platform%2Fupstream%2Fconnman.git diff --git a/src/wispr.c b/src/wispr.c index 62f6b8d..3b203fb 100755 --- a/src/wispr.c +++ b/src/wispr.c @@ -559,12 +559,31 @@ static void wispr_portal_browser_reply_cb(struct connman_service *service, const char *error, void *user_data) { struct connman_wispr_portal_context *wp_context = user_data; + struct connman_wispr_portal *wispr_portal; + int index; DBG(""); if (!service || !wp_context) return; + /* + * No way to cancel this if wp_context has been freed, so we lookup + * from the service and check that this is still the right context. + */ + index = __connman_service_get_index(service); + if (index < 0) + return; + + wispr_portal = g_hash_table_lookup(wispr_portal_list, + GINT_TO_POINTER(index)); + if (!wispr_portal) + return; + + if (wp_context != wispr_portal->ipv4_context && + wp_context != wispr_portal->ipv6_context) + return; + if (!authentication_done) { wispr_portal_error(wp_context); free_wispr_routes(wp_context);