Skip to content

Commit

Permalink
plug a few leaks in revision walking used in describe.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 12, 2007
1 parent 80dbae0 commit 94d2367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions builtin-describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static void describe(const char *arg, int last_one)
cur_match->depth++;
if (!min_match || cur_match->depth < min_match->depth)
min_match = cur_match;
free_commit_list(revs.commits);
}
printf("%s-g%s\n", min_match->name->path,
find_unique_abbrev(cmit->object.sha1, abbrev));
Expand Down
8 changes: 5 additions & 3 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,21 +1121,23 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
void prepare_revision_walk(struct rev_info *revs)
{
int nr = revs->pending.nr;
struct object_array_entry *list = revs->pending.objects;
struct object_array_entry *e, *list;

e = list = revs->pending.objects;
revs->pending.nr = 0;
revs->pending.alloc = 0;
revs->pending.objects = NULL;
while (--nr >= 0) {
struct commit *commit = handle_commit(revs, list->item, list->name);
struct commit *commit = handle_commit(revs, e->item, e->name);
if (commit) {
if (!(commit->object.flags & SEEN)) {
commit->object.flags |= SEEN;
insert_by_date(commit, &revs->commits);
}
}
list++;
e++;
}
free(list);

if (revs->no_walk)
return;
Expand Down

0 comments on commit 94d2367

Please sign in to comment.