cogl/xlib-renderer: Plug some leaks

Found them while reworking this file. XRRFree*Info() fully free the
pointers inside the infos, they're more appropriate.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3792>
This commit is contained in:
Georges Basile Stavracas Neto 2024-06-01 10:08:33 +02:00 committed by Marge Bot
parent 64d0e503ff
commit 2a9576c59c

View File

@ -273,11 +273,8 @@ update_outputs (CoglRenderer *renderer,
new_outputs = g_list_prepend (new_outputs, output); new_outputs = g_list_prepend (new_outputs, output);
next: next:
if (crtc_info != NULL) g_clear_pointer (&crtc_info, XRRFreeCrtcInfo);
XFree (crtc_info); g_clear_pointer (&output_info, XRRFreeOutputInfo);
if (output_info != NULL)
XFree (output_info);
} }
XFree (resources); XFree (resources);
@ -316,6 +313,8 @@ update_outputs (CoglRenderer *renderer,
m_next, m_next,
g_steal_pointer (&l->data)); g_steal_pointer (&l->data));
g_clear_pointer (&output_m, free_xlib_output);
changed = TRUE; changed = TRUE;
} }
@ -336,6 +335,7 @@ update_outputs (CoglRenderer *renderer,
GList *m_next = m->next; GList *m_next = m->next;
xlib_renderer->outputs = xlib_renderer->outputs =
g_list_remove_link (xlib_renderer->outputs, m); g_list_remove_link (xlib_renderer->outputs, m);
g_clear_pointer (&output_m, free_xlib_output);
changed = TRUE; changed = TRUE;
m = m_next; m = m_next;
} }