From f36b66bef770027b651366e128158b4b79cd10a8 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Wed, 26 Nov 2014 09:42:32 +0100 Subject: [PATCH] Fixed missed policy decision in callback (#146). Added also missed g_free on uri returned by hsts_get_changed_uri. --- src/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 8229c68..6ed8eb8 100644 --- a/src/main.c +++ b/src/main.c @@ -1244,14 +1244,21 @@ static gboolean navigation_decision_requested_cb(WebKitWebView *view, uri = hsts_get_changed_uri(vb.session, msg); if (uri) { webkit_web_view_load_uri(view, uri); + webkit_web_policy_decision_ignore(policy); + g_free(uri); /* mark the request as handled */ return true; } #endif /* try to find a protocol handler to open the uri */ - return handle_uri(webkit_network_request_get_uri(request)); + if (handle_uri(webkit_network_request_get_uri(request))) { + webkit_web_policy_decision_ignore(policy); + + return true; + } + return false; } static void hover_link_cb(WebKitWebView *webview, const char *title, const char *link) -- 2.20.1