diff --git a/kbx/keybox-openpgp.c b/kbx/keybox-openpgp.c index a5f602b7b..a0e4ab9f7 100644 --- a/kbx/keybox-openpgp.c +++ b/kbx/keybox-openpgp.c @@ -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); 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; }