diff options
author | Jeff King <peff@peff.net> | 2016-06-17 19:38:43 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-17 17:03:56 -0700 |
commit | 4322353bfb53a83e6657af50603d3521ee9d7d0c (patch) | |
tree | ddfc44a7a1f337a93237d434473cc8b52b3effff /editor.c | |
parent | verify_signed_buffer: drop pbuf variable (diff) | |
download | tgif-4322353bfb53a83e6657af50603d3521ee9d7d0c.tar.xz |
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 'editor.c')
0 files changed, 0 insertions, 0 deletions