wayland: Don't free non-transferred string when cleaning up
When cleaning up the display name string management, the display name string retrieved from libwayland-server was also passed to free() on clean up. This is invalid as the display name string ownership is not transferred to us. Fix this by strdup:ing the string before saving it. https://bugzilla.gnome.org/show_bug.cgi?id=730551
This commit is contained in:
parent
8499a29d0a
commit
807658e972
@ -376,10 +376,13 @@ meta_wayland_init (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
compositor->display_name =
|
||||
wl_display_add_socket_auto (compositor->wayland_display);
|
||||
if (compositor->display_name == NULL)
|
||||
const char *display_name;
|
||||
|
||||
display_name = wl_display_add_socket_auto (compositor->wayland_display);
|
||||
if (!display_name)
|
||||
g_error ("Failed to create socket");
|
||||
|
||||
compositor->display_name = g_strdup (display_name);
|
||||
}
|
||||
|
||||
set_gnome_env ("DISPLAY", meta_wayland_get_xwayland_display_name (compositor));
|
||||
|
Loading…
Reference in New Issue
Block a user