mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 16:00:18 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user