From f4b5f197de357a1e4a99fb79f8197c5c743f113c Mon Sep 17 00:00:00 2001 From: monsta Date: Sun, 2 Nov 2014 13:03:45 +0300 Subject: don't leak memory Closes https://github.com/mate-desktop/mate-desktop/pull/138 --- libmate-desktop/mate-rr-config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libmate-desktop/mate-rr-config.c b/libmate-desktop/mate-rr-config.c index 2cd002c..1efa124 100644 --- a/libmate-desktop/mate-rr-config.c +++ b/libmate-desktop/mate-rr-config.c @@ -442,8 +442,8 @@ out: MateRRConfig * mate_rr_config_new_current (MateRRScreen *screen) { - MateRRConfig *config = g_new0 (MateRRConfig, 1); - GPtrArray *a = g_ptr_array_new (); + MateRRConfig *config; + GPtrArray *a; MateRROutput **rr_outputs; int i; int clone_width = -1; @@ -452,6 +452,9 @@ mate_rr_config_new_current (MateRRScreen *screen) g_return_val_if_fail (screen != NULL, NULL); + config = g_new0 (MateRRConfig, 1); + a = g_ptr_array_new (); + rr_outputs = mate_rr_screen_list_outputs (screen); config->clone = FALSE; @@ -1109,6 +1112,7 @@ mate_rr_config_save (MateRRConfig *configuration, GError **error) g_free (backup_filename); g_free (intended_filename); + g_string_free (output, TRUE); return result; } -- cgit v1.2.1