[Spice-devel] [PATCH spice-gtk] spice-widget: update_monitor_area: Fix memory-leak on whole fallback

Hans de Goede hdegoede at redhat.com
Fri Jan 18 07:28:22 PST 2013


When we've successfully gotten the monitors display-channel property, but
still end up falling back to whole-display mode, we still need to free
the monitors array.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/spice-widget.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index f1628d9..81670c3 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -302,6 +302,7 @@ static void update_monitor_area(SpiceDisplay *display)
     return;
 
 whole:
+    g_clear_pointer(&monitors, g_array_unref);
     /* by display whole surface */
     update_area(display, 0, 0, d->width, d->height);
     set_monitor_ready(display, true);
-- 
1.8.0.2



More information about the Spice-devel mailing list