Skip to content

Commit

Permalink
Merge pull request #135 from scriptum/treebrowser-fix-leaks
Browse files Browse the repository at this point in the history
Treebrowser: exclude false-positives, fix memory leaks
  • Loading branch information
frlan committed Apr 1, 2014
2 parents 4abc8a4 + d5b91ee commit bd36546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions treebrowser/src/Makefile.am
Expand Up @@ -6,4 +6,7 @@ treebrowser_la_SOURCES = treebrowser.c
treebrowser_la_CFLAGS = $(AM_CFLAGS) $(GIO_CFLAGS)
treebrowser_la_LIBADD = $(COMMONLIBS) $(GIO_LIBS)

AM_CPPCHECKFLAGS = --suppress='deallocDealloc:$(srcdir)/treebrowser.c'
AM_CPPCHECKFLAGS += --suppress='doubleFree:$(srcdir)/treebrowser.c'

include $(top_srcdir)/build/cppcheck.mk
4 changes: 3 additions & 1 deletion treebrowser/src/treebrowser.c
Expand Up @@ -685,6 +685,7 @@ treebrowser_load_bookmarks(void)
gtk_tree_path_free(tree_path);
}
}
g_free(bookmarks);
}

static gboolean
Expand Down Expand Up @@ -726,7 +727,6 @@ treebrowser_search(gchar *uri, gpointer parent)
static void
fs_remove(gchar *root, gboolean delete_root)
{
GDir *dir;
gchar *path;
const gchar *name;

Expand All @@ -735,6 +735,7 @@ fs_remove(gchar *root, gboolean delete_root)

if (g_file_test(root, G_FILE_TEST_IS_DIR))
{
GDir *dir;
dir = g_dir_open (root, 0, NULL);

if (!dir)
Expand All @@ -756,6 +757,7 @@ fs_remove(gchar *root, gboolean delete_root)
g_free(path);
name = g_dir_read_name(dir);
}
g_dir_close(dir);
}
else
delete_root = TRUE;
Expand Down

0 comments on commit bd36546

Please sign in to comment.