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

fix potential memory leak in netpgp

This commit is contained in:
B. Petersen 2017-11-26 16:32:21 +01:00
parent 3a7d25b8aa
commit d2c65ad112

View file

@ -1090,6 +1090,9 @@ pgp_create_pk_sesskey(pgp_key_t *key, const char *ciphername, pgp_pk_sesskey_t *
sesskey->symm_alg = cipher;
if(initial_sesskey){
if(initial_sesskey->symm_alg != cipher){
free(unencoded_m_buf); // EDIT BY MR: fix potential memory leak
free(encoded_m_buf); // - " -
free(sesskey); // - " -
return NULL;
}
memcpy(sesskey->key, initial_sesskey->key, cipherinfo.keysize);