summaryrefslogtreecommitdiff
path: root/archive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-06-17 19:38:43 -0400
committerJunio C Hamano <gitster@pobox.com>2016-06-17 17:03:56 -0700
commit4322353bfb53a83e6657af50603d3521ee9d7d0c (patch)
treeddfc44a7a1f337a93237d434473cc8b52b3effff /archive.c
parentc752fcc8e0df02c6b1bd4daec1d08f0f2bcca58a (diff)
downloadgit-4322353bfb53a83e6657af50603d3521ee9d7d0c.tar.gz
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 'archive.c')
0 files changed, 0 insertions, 0 deletions