diff options
author | Werner Koch <wk@gnupg.org> | 2016-01-06 08:39:08 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-01-06 08:39:08 +0100 |
commit | db82b6131d437bf6ba34db0e08b7dfa9edb11e45 (patch) | |
tree | d56b3bd97e7301fa960d81c39b516256a92b133f /kbx/keybox-update.c | |
parent | dirmngr: Silence one regression test. (diff) | |
download | gnupg2-db82b6131d437bf6ba34db0e08b7dfa9edb11e45.tar.xz gnupg2-db82b6131d437bf6ba34db0e08b7dfa9edb11e45.zip |
kbx: Avoid faulty fclose in an error case.
* kbx/keybox-update.c (blob_filecopy): Do not close an uninitialized
file pointer after a failure to create a temp file.
* kbx/keybox-openpgp.c (next_packet): Remove duplicate assignment of
PKTLEN.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to '')
-rw-r--r-- | kbx/keybox-update.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kbx/keybox-update.c b/kbx/keybox-update.c index ef3e33009..aa8086550 100644 --- a/kbx/keybox-update.c +++ b/kbx/keybox-update.c @@ -271,12 +271,11 @@ blob_filecopy (int mode, const char *fname, KEYBOXBLOB blob, goto leave; } - /* Create the new file. */ + /* Create the new file. On success NEWFP is initialized. */ rc = create_tmp_file (fname, &bakfname, &tmpfname, &newfp); if (rc) { fclose (fp); - fclose (newfp); goto leave; } |