Re: [PATCH 3/3] clone: Free a few paths
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 18, 2011, 07:25 UTC
- Message-ID
- <7v4o70zy96.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110314194501.GA30483@elie>
Jonathan Nieder <jrnieder@gmail.com> writes:
> Thanks. The commit message should probably mention that this is for > the sake of valgrind rather a true memory leak, since the memory is > freed by _exit at the appropriate time already.
Or perhaps you are planning to split larger later half of cmd_clone() into a helper function, so that other people can call it after doing their own command line processing.
> The patch itself seems sane, since the performance effect should be > negligible.
Perhaps and yes.
I would have preferred a patch to free path and dir without doing anything else, as path is coming from get_repo_path() that always return a string on heap, and dir comes either directly from xstrdup() or guess_dir_name() that gives strbuf_detach() or xstrndup() result to us, and they are clearly leaking and are safely freed, though.