diff options
author | Jeff King <peff@peff.net> | 2014-08-27 03:57:56 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-08-29 10:33:28 -0700 |
commit | f4ef51739343f80c7cb0467244925b3725d65730 (patch) | |
tree | 8e97ad99b286cf2e68150ca48df5d37a526e44b2 /fast-import.c | |
parent | determine_author_info(): reuse parsing functions (diff) | |
download | tgif-f4ef51739343f80c7cb0467244925b3725d65730.tar.xz |
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 'fast-import.c')
0 files changed, 0 insertions, 0 deletions