summaryrefslogtreecommitdiffstats
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-19 23:29:48 +0200
committerJunio C Hamano <gitster@pobox.com>2014-06-20 00:20:56 +0200
commitf33206992de994424036a7d9912a968ab9829e6e (patch)
tree1d3c9a7bfafe5498ba00c7945942d9ed824f2dd6 /git-mergetool.sh
parentmerge: use argv_array when spawning merge strategy (diff)
downloadgit-f33206992de994424036a7d9912a968ab9829e6e.tar.xz
git-f33206992de994424036a7d9912a968ab9829e6e.zip
walker_fetch: fix minor memory leak
We sometimes allocate "msg" on the heap, but will fail to free it if we hit the failure code path. We can instead keep a separate variable that is safe to be freed no matter how we get to the failure code path. While we're here, we can also do two readability improvements: 1. Use xstrfmt instead of a manual malloc/sprintf 2. Due to the "maybe we allocate msg, maybe we don't" strategy, the logic for deciding which message to show was split into two parts. Since the deallocation is now pushed onto a separate variable, this is no longer a concern, and we can keep all of the logic in the same place. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool.sh')
0 files changed, 0 insertions, 0 deletions