From 5b0538f71c00c8a8275003308105a890ee9e6890 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 1 Nov 2021 13:18:54 +0100 Subject: Use g_uri_unref instead of g_free on g_uri_parse --- badwolf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 4c5a481..8578404 100644 --- 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: + */ + g_uri_unref(failing_uri); #else soup_uri_free(failing_uri); #endif -- cgit v1.3.1-23-gd82d