wt-status: plug memory leak while collecting untracked files
authorJunio C Hamano <gitster@pobox.com>
Sat, 10 Apr 2010 06:58:27 +0000 (23:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 10 Apr 2010 07:43:59 +0000 (00:43 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wt-status.c
index db20b86102691fdf516aa977e6d4950f2bc31ac1..c88159ad068ccde1c8057d91babc567174f8394d 100644 (file)
@@ -379,7 +379,10 @@ static void wt_status_collect_untracked(struct wt_status *s)
                if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
                        continue;
                string_list_insert(ent->name, &s->untracked);
+               free(ent);
        }
+
+       free(dir.entries);
 }
 
 void wt_status_collect(struct wt_status *s)