path: root/pathspec.c
diff options
authorJeff King <>2017-09-20 20:36:59 (GMT)
committerJunio C Hamano <>2017-09-21 04:09:46 (GMT)
commit7fa3c2ad6d06428dcbd801ced55dffd22027cc96 (patch)
tree87c6e882ddb3bafe97eace6ca64ee08acac818b3 /pathspec.c
parent9ddaf86b06a8078420f59aec8cab6daa93cf1a91 (diff)
revision: replace "struct cmdline_pathspec" with argv_array
We assemble an array of strings in a custom struct, NULL-terminate the result, and then pass it to parse_pathspec(). But then we never free the array or the individual strings (nor can we do the latter, as they are heap-allocated when they come from stdin but not when they come from the passed-in argv). Let's swap this out for an argv_array. It does the same thing with fewer lines of code, and it's safe to call argv_array_clear() at the end to avoid a memory leak. Reported-by: Martin Ă…gren <> Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pathspec.c')
0 files changed, 0 insertions, 0 deletions