mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-27 14:54:14 +00:00
Avoid potential memory leak in spice session
If j == -1, the memory allocated for rect will leak. So move the allocation after the test. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
parent
ba9c79b55e
commit
c07cc4f89f
@ -1067,11 +1067,11 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
|
||||
displays = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
|
||||
|
||||
for (l = initial_displays; l != NULL; l = l->next) {
|
||||
GdkRectangle* rect = g_new0(GdkRectangle, 1);;
|
||||
gint j = virt_viewer_app_get_initial_monitor_for_display(app, GPOINTER_TO_INT(l->data));
|
||||
if (j == -1)
|
||||
continue;
|
||||
|
||||
GdkRectangle* rect = g_new0(GdkRectangle, 1);;
|
||||
gdk_screen_get_monitor_geometry(screen, j, rect);
|
||||
g_hash_table_insert(displays, l->data, rect);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user