diff options
author | Jeff King <peff@peff.net> | 2014-08-27 11:57:56 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-08-29 21:33:28 +0400 |
commit | f4ef51739343f80c7cb0467244925b3725d65730 (patch) | |
tree | 8e97ad99b286cf2e68150ca48df5d37a526e44b2 /ident.c | |
parent | f0f9662ae9d1c7f58a95397d1c6d5f31760b14be (diff) |
determine_author_info(): copy getenv output
When figuring out the author name for a commit, we may end
up either pointing to const storage from getenv("GIT_AUTHOR_*"),
or to newly allocated storage based on an existing commit or
the --author option.
Using const pointers to getenv's return has two problems:
1. It is not guaranteed that the return value from getenv
remains valid across multiple calls.
2. We do not know whether to free the values at the end,
so we just leak them.
We can solve both by duplicating the string returned by
getenv().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ident.c')
0 files changed, 0 insertions, 0 deletions