Skip to content

Commit e2b999b

Browse files
committed
Fix leaks in wp11_EncryptData & wp11_DecryptData
F-493
1 parent ac51233 commit e2b999b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/internal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,6 +2831,7 @@ static int wp11_EncryptData(byte* out, byte* data, int len, byte* key,
28312831
ret = wc_AesGcmEncrypt(&aes, out, data, len, iv, ivSz, out + len,
28322832
AES_BLOCK_SIZE, NULL, 0);
28332833
}
2834+
wc_AesFree(&aes);
28342835

28352836
return ret;
28362837
}
@@ -2865,6 +2866,7 @@ static int wp11_DecryptData(byte* out, byte* data, int len, byte* key,
28652866
ret = wc_AesGcmDecrypt(&aes, out, data, len, iv, ivSz, data + len,
28662867
AES_BLOCK_SIZE, NULL, 0);
28672868
}
2869+
wc_AesFree(&aes);
28682870

28692871
return ret;
28702872
}

0 commit comments

Comments
 (0)