Fixed a crash-prone memory management path in Linux URL launching by only freeing the previous environment vector when g_environ_unsetenv() returns a different pointer. This avoids freeing memory that may still be owned/returned as-is by GLib, which matches your segfault symptoms when opening links from the AppImage build.

The fix is in fe_open_url_inner() right where LD_LIBRARY_PATH and LD_PRELOAD are sanitized before spawning xdg-open.
This commit is contained in:
2026-02-24 20:29:48 -07:00
parent 3ed66f9945
commit 618aecd349

View File

@@ -1693,11 +1693,13 @@ fe_open_url_inner (const char *url)
{
gchar **tmp_env = spawn_env;
spawn_env = g_environ_unsetenv (tmp_env, "LD_LIBRARY_PATH");
g_strfreev (tmp_env);
if (spawn_env != tmp_env)
g_strfreev (tmp_env);
tmp_env = spawn_env;
spawn_env = g_environ_unsetenv (tmp_env, "LD_PRELOAD");
g_strfreev (tmp_env);
if (spawn_env != tmp_env)
g_strfreev (tmp_env);
}
/* Prefer xdg-open when available because gtk_show_uri can inherit