mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-05 19:42:04 +02:00
fix potential memory leak in netpgp
This commit is contained in:
parent
3a7d25b8aa
commit
d2c65ad112
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue