summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
authormonsta <[email protected]>2014-11-02 13:03:45 +0300
committerStefano Karapetsas <[email protected]>2014-11-28 08:38:19 +0100
commitf4b5f197de357a1e4a99fb79f8197c5c743f113c (patch)
tree7989eaeb4f3ae8569147a5e5260cf322eb404faa /libmate-desktop
parent3042b45cf9d10a0e194daf457c619c368edaab4f (diff)
downloadmate-desktop-f4b5f197de357a1e4a99fb79f8197c5c743f113c.tar.bz2
mate-desktop-f4b5f197de357a1e4a99fb79f8197c5c743f113c.tar.xz
don't leak memory
Closes https://github.com/mate-desktop/mate-desktop/pull/138
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-rr-config.c8
1 files 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;
}