Skip to content

Commit

Permalink
Merge branch 'nd/dir-exclude-cleanup'
Browse files Browse the repository at this point in the history
The "exclude_list" structure has the usual "alloc, nr" pair of
fields to be used by ALLOC_GROW(), but clear_exclude_list() forgot
to reset 'alloc' to 0 when it cleared 'nr'to discard the managed
array.

* nd/dir-exclude-cleanup:
  dir.c: clean the entire struct in clear_exclude_list()
  • Loading branch information
Junio C Hamano committed Jan 20, 2016
2 parents 4fd1359 + 2653a8c commit 7a450b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,7 @@ void clear_exclude_list(struct exclude_list *el)
free(el->excludes);
free(el->filebuf);

el->nr = 0;
el->excludes = NULL;
el->filebuf = NULL;
memset(el, 0, sizeof(*el));
}

static void trim_trailing_spaces(char *buf)
Expand Down

0 comments on commit 7a450b4

Please sign in to comment.