1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00

check for some NULL-pointers, tackles #333

This commit is contained in:
B. Petersen 2018-09-29 14:27:40 +02:00
parent a0dafac6b9
commit d7ab3446d7
2 changed files with 12 additions and 0 deletions

View file

@ -122,6 +122,10 @@ pgp_key_free(pgp_key_t *key)
{
unsigned n;
if (key==NULL) {
return;
}
if (key->type == PGP_PTAG_CT_PUBLIC_KEY) {
pgp_pubkey_free(&key->key.pubkey);
} else {

View file

@ -968,6 +968,10 @@ cmd_get_passphrase_free(pgp_seckey_passphrase_t *skp)
static void
free_BN(BIGNUM **pp)
{
if (pp==NULL || *pp==NULL) {
return;
}
BN_free(*pp);
*pp = NULL;
}
@ -1272,6 +1276,10 @@ pgp_pk_sesskey_free(pgp_pk_sesskey_t *sk)
void
pgp_pubkey_free(pgp_pubkey_t *p)
{
if (p==NULL) {
return;
}
switch (p->alg) {
case PGP_PKA_RSA:
case PGP_PKA_RSA_ENCRYPT_ONLY: