mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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>
This commit is contained in:
parent
6deafb92ab
commit
db82b6131d
2 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue