From d37ec4b473b4191f871a02fbb04d915a222ae5ba Mon Sep 17 00:00:00 2001 From: Monsta Date: Thu, 6 Nov 2014 13:26:30 +0300 Subject: don't leak memory --- applets/clock/clock-face.c | 1 + applets/fish/fish.c | 2 +- mate-panel/launcher.c | 2 +- mate-panel/libpanel-util/panel-icon-chooser.c | 1 + mate-panel/menu.c | 1 + mate-panel/panel-run-dialog.c | 2 +- mate-panel/panel-test-applets.c | 1 + mate-panel/panel-util.c | 1 + 8 files changed, 8 insertions(+), 3 deletions(-) diff --git a/applets/clock/clock-face.c b/applets/clock/clock-face.c index dfe1e224..77c5de4b 100644 --- a/applets/clock/clock-face.c +++ b/applets/clock/clock-face.c @@ -545,6 +545,7 @@ clock_face_load_face (ClockFace *this, gint width, gint height) priv->face_pixbuf = g_hash_table_lookup (pixbuf_cache, cache_name); if (priv->face_pixbuf) { g_object_ref (priv->face_pixbuf); + g_free (cache_name); return; } diff --git a/applets/fish/fish.c b/applets/fish/fish.c index 5ab04e09..d097d12d 100644 --- a/applets/fish/fish.c +++ b/applets/fish/fish.c @@ -1129,8 +1129,8 @@ static char* get_location(void) count++; if (count != 2) { - return NULL; g_free (buffer); + return NULL; } memcpy (location, &buffer [i + 2], len - i - 2); diff --git a/mate-panel/launcher.c b/mate-panel/launcher.c index d569e757..4928fa34 100644 --- a/mate-panel/launcher.c +++ b/mate-panel/launcher.c @@ -466,7 +466,7 @@ create_launcher (const char *location) g_error_free (error); g_key_file_free (key_file); - + g_free (new_location); return NULL; /*button is null*/ } diff --git a/mate-panel/libpanel-util/panel-icon-chooser.c b/mate-panel/libpanel-util/panel-icon-chooser.c index a24d425e..6772019c 100644 --- a/mate-panel/libpanel-util/panel-icon-chooser.c +++ b/mate-panel/libpanel-util/panel-icon-chooser.c @@ -459,6 +459,7 @@ _panel_icon_chooser_clicked (GtkButton *button) path = g_build_filename (DATADIR, "icons", NULL); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filechooser), path); + g_free (path); } gtk_window_set_destroy_with_parent (GTK_WINDOW (filechooser), TRUE); diff --git a/mate-panel/menu.c b/mate-panel/menu.c index c9e0bcf6..462a3293 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -801,6 +801,7 @@ menu_escape_underscores_and_prepend (const char *text) if (c == (gunichar)-1) { g_warning ("Invalid input string for underscore escaping"); + g_string_free (escaped_text, TRUE); return g_strdup (text); } else if (c == '_') { g_string_insert_c (escaped_text, diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c index 0e9068f8..9da6ce03 100644 --- a/mate-panel/panel-run-dialog.c +++ b/mate-panel/panel-run-dialog.c @@ -622,13 +622,13 @@ fuzzy_command_match (const char *cmd1, /* same for the user command */ tokens = g_strsplit (cmd2, " ", -1); - word2 = g_path_get_basename (tokens [0]); if (!tokens || !tokens [0]) { g_free (word1); g_strfreev (tokens); return FALSE; } + word2 = g_path_get_basename (tokens [0]); g_strfreev (tokens); if (!strcmp (word1, word2)) { diff --git a/mate-panel/panel-test-applets.c b/mate-panel/panel-test-applets.c index 152a65ea..aa83bbbe 100644 --- a/mate-panel/panel-test-applets.c +++ b/mate-panel/panel-test-applets.c @@ -309,6 +309,7 @@ setup_options (void) for (i = 0; !unique_key_found; i++) { + g_free (unique_key); unique_key = g_strdup_printf ("mate-panel-test-applet-%d", i); unique_key_found = TRUE; dconf_paths = mate_dconf_list_subdirs ("/tmp/", TRUE); diff --git a/mate-panel/panel-util.c b/mate-panel/panel-util.c index f3ab7bc7..b9af4675 100644 --- a/mate-panel/panel-util.c +++ b/mate-panel/panel-util.c @@ -790,6 +790,7 @@ guess_icon_from_exec (GtkIconTheme *icon_theme, return NULL; } + g_free (path); return icon_name; } -- cgit v1.2.1