Skip to content

Commit

Permalink
treebrowser: Fix a potential invalid free
Browse files Browse the repository at this point in the history
  • Loading branch information
b4n committed Jun 20, 2012
1 parent dc6c21f commit 3388d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions treebrowser/src/treebrowser.c
Expand Up @@ -791,7 +791,7 @@ treebrowser_expand_to_path(gchar* root, gchar* find)
{
int i = 0;
gboolean founded = FALSE, global_founded = FALSE;
gchar *new = "";
gchar *new = NULL;
gchar **root_segments = NULL, **find_segments = NULL;
guint root_segments_n = 0, find_segments_n = 0;

Expand All @@ -804,7 +804,7 @@ treebrowser_expand_to_path(gchar* root, gchar* find)

for (i = 1; i<=find_segments_n; i++)
{
new = g_strconcat(new, G_DIR_SEPARATOR_S, find_segments[i], NULL);
new = g_strconcat(new ? new : "", G_DIR_SEPARATOR_S, find_segments[i], NULL);

if (founded)
{
Expand Down

0 comments on commit 3388d87

Please sign in to comment.