diff options
author | Jeff King <peff@peff.net> | 2017-09-20 23:36:59 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-21 07:09:46 +0300 |
commit | 7fa3c2ad6d06428dcbd801ced55dffd22027cc96 (patch) | |
tree | 87c6e882ddb3bafe97eace6ca64ee08acac818b3 /pathspec.c | |
parent | 9ddaf86b06a8078420f59aec8cab6daa93cf1a91 (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 <martin.agren@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
0 files changed, 0 insertions, 0 deletions