summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-06-17 23:38:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-06-18 00:03:56 (GMT)
commit4322353bfb53a83e6657af50603d3521ee9d7d0c (patch)
treeddfc44a7a1f337a93237d434473cc8b52b3effff /run-command.c
parentc752fcc8e0df02c6b1bd4daec1d08f0f2bcca58a (diff)
downloadgit-4322353bfb53a83e6657af50603d3521ee9d7d0c.zip
git-4322353bfb53a83e6657af50603d3521ee9d7d0c.tar.gz
git-4322353bfb53a83e6657af50603d3521ee9d7d0c.tar.bz2
verify_signed_buffer: use tempfile object
We use git_mkstemp to create a temporary file, and try to clean it up in all exit paths from the function. But that misses any cases where we die by signal, or by calling die() in a sub-function. In addition, we missed one of the exit paths. Let's convert to using a tempfile object, which handles the hard cases for us, and add the missing cleanup call. Note that we would not simply want to rely on program exit to catch our missed cleanup, as this function may be called many times in a single program (for the same reason, we use a static tempfile instead of heap-allocating a new one; that gives an upper bound on our memory usage). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
0 files changed, 0 insertions, 0 deletions