Browse Source

Avoid free if not seckey subkey wasn't allocated

master
Edouard Tisserant 7 years ago
parent
commit
dde1dee894
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      dist/src/lib/validate.c

+ 2
- 1
dist/src/lib/validate.c View File

@ -231,7 +231,8 @@ static void validate_key_cb_free (validate_key_cb_t *vdata){
pgp_pubkey_free(&vdata->subkey.pubkey);
} else if (vdata->type == PGP_PTAG_CT_SECRET_KEY) {
pgp_seckey_free(&vdata->key.seckey);
pgp_seckey_free(&vdata->subkey.seckey);
if(vdata->subkey.seckey.pubkey.alg)
pgp_seckey_free(&vdata->subkey.seckey);
}
memset(&vdata->key, 0, sizeof(vdata->key));
memset(&vdata->subkey, 0, sizeof(vdata->subkey));


Loading…
Cancel
Save