Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Fri, 06 Feb 2015 14:44:48 UTC Commit: c12f0d33c96b6a6fd3a3dc7a876d45311d84a086 https://github.com/geany/geany-plugins/commit/c12f0d33c96b6a6fd3a3dc7a876d45...
Log Message: ----------- projectorganizer: Fix some minor memory leaks
Modified Paths: -------------- projectorganizer/src/prjorg-menu.c projectorganizer/src/prjorg-sidebar.c
Modified: projectorganizer/src/prjorg-menu.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -53,7 +53,6 @@ static GtkWidget *s_fif_item, *s_ff_item, *s_ft_item, *s_shs_item, *s_sep_item, static gboolean try_swap_header_source(gchar *file_name, gboolean is_header, GSList *file_list, GSList *header_patterns, GSList *source_patterns) { gchar *name_pattern; - gchar *base_name = NULL; GSList *elem; GPatternSpec *pattern; gboolean found = FALSE; @@ -67,7 +66,7 @@ static gboolean try_swap_header_source(gchar *file_name, gboolean is_header, GSL foreach_slist (elem, file_list) { gchar *full_name = elem->data; - base_name = g_path_get_basename(full_name); + gchar *base_name = g_path_get_basename(full_name);
if (g_pattern_match_string(pattern, base_name) && prjorg_project_is_in_project(full_name)) @@ -77,12 +76,13 @@ static gboolean try_swap_header_source(gchar *file_name, gboolean is_header, GSL { open_file(full_name); found = TRUE; + g_free(base_name); break; } } + g_free(base_name); }
- g_free(base_name); g_pattern_spec_free(pattern); return found; }
Modified: projectorganizer/src/prjorg-sidebar.c 4 lines changed, 1 insertions(+), 3 deletions(-) =================================================================== @@ -352,8 +352,6 @@ static void find_file_recursive(GtkTreeIter *iter, gboolean case_sensitive, gboo if (iter == NULL) return;
- gtk_tree_model_get(GTK_TREE_MODEL(model), iter, FILEVIEW_COLUMN_NAME, &name, -1); - if (full_path) { gchar *path; @@ -363,7 +361,7 @@ static void find_file_recursive(GtkTreeIter *iter, gboolean case_sensitive, gboo g_free(path); } else - name = g_strdup(name); + gtk_tree_model_get(GTK_TREE_MODEL(model), iter, FILEVIEW_COLUMN_NAME, &name, -1);
if (!case_sensitive) SETPTR(name, g_utf8_strdown(name, -1));
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org