logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git
commit: 5b0538f71c00c8a8275003308105a890ee9e6890
parent e6226251e5603810d2e8211cd46f16ec43e3339f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  1 Nov 2021 13:18:54 +0100

Use g_uri_unref instead of g_free on g_uri_parse

Diffstat:

Mbadwolf.c11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/badwolf.c b/badwolf.c @@ -476,7 +476,16 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, } #ifndef USE_LIBSOUP2 - g_free(failing_uri); + /* Calling g_free(failing_uri) ought to be the correct way but this causes a segfault. + * + * - documentation describes it as something which should be free + * - implementation seems to make it a pointer that should be freed + * - epiphany doesn't seems to free/unref it but gnome code seems to frequently have memleaks + * + * Decided to at least continue to try with using g_uri_unref(failing_uri) instead. + * Related fediverse post: <https://queer.hacktivis.me/objects/cec7c4e8-6a58-4358-85bf-b66f9bb21a98> + */ + g_uri_unref(failing_uri); #else soup_uri_free(failing_uri); #endif