Re: [PATCH] revision: fix memory leaks with `struct cmdline_pathspec`

2017-09-20 Thread Jeff King
On Wed, Sep 20, 2017 at 09:47:26PM +0200, Martin Ågren wrote: > We don't free the array `prune_data.path` or the individual strings it > points to. Do so by introducing and using `free_cmdline_pathspec()`. To > be able to safely free the strings, always use `xstrdup()` when > assigning them. That

[PATCH] revision: fix memory leaks with `struct cmdline_pathspec`

2017-09-20 Thread Martin Ågren
We don't free the array `prune_data.path` or the individual strings it points to. Do so by introducing and using `free_cmdline_pathspec()`. To be able to safely free the strings, always use `xstrdup()` when assigning them. That does mean we allocate more memory than we used to, but it also means