fixed memory leaks

This commit is contained in:
TLINDEN
2014-08-07 00:02:43 +02:00
parent 8954df7110
commit 9672785271
9 changed files with 60 additions and 24 deletions

View File

@@ -148,6 +148,7 @@ pcp_key_t *pcpkey_encrypt(PCPCTX *ptx, pcp_key_t *key, char *passphrase) {
if(key->nonce[0] == 0) {
byte *nonce = pcp_gennonce();
memcpy (key->nonce, nonce, crypto_secretbox_NONCEBYTES);
ucfree(nonce, crypto_secretbox_NONCEBYTES);
}
byte *encryptkey = pcp_derivekey(ptx, passphrase, key->nonce);