mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01: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
@ -71,7 +71,6 @@ next_packet (unsigned char const **bufptr, size_t *buflen,
|
||||
if ( !(ctb & 0x80) )
|
||||
return gpg_error (GPG_ERR_INV_PACKET); /* Invalid CTB. */
|
||||
|
||||
pktlen = 0;
|
||||
if ((ctb & 0x40)) /* New style (OpenPGP) CTB. */
|
||||
{
|
||||
pkttype = (ctb & 0x3f);
|
||||
|
@ -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…
x
Reference in New Issue
Block a user