Re: [PATCH v6 18/19] fsck: git receive-pack: support excluding objects from fsck'ing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2015, 17:28 UTC
- Message-ID
- <xmqq4mm2l25m.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <9b7c42e6ec81fd70015b8fe9ff2bd137@www.dscho.org>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> There is a problem, though: `git_config_pathname()` accepts a > `const char **` parameter to set the path, yet I need to `free()` > that pointer afterwards because it has been obtained through > `expand_user_path()` which detaches that buffer from a `strbuf`.
"I have 'const char *' because I do not ever change the string myself after getting it from an API function, but free() does not want to free a const pointer" occurs sometimes in our codebase and it is OK to cast the constness away (many callsites to free() already do so).