mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
Fix memory leak in Nettle crypto backend.
This commit is contained in:
@@ -265,8 +265,8 @@ int crypt_hmac_final(struct crypt_hmac *ctx, char *buffer, size_t length)
|
|||||||
int crypt_hmac_destroy(struct crypt_hmac *ctx)
|
int crypt_hmac_destroy(struct crypt_hmac *ctx)
|
||||||
{
|
{
|
||||||
memset(ctx->key, 0, ctx->key_length);
|
memset(ctx->key, 0, ctx->key_length);
|
||||||
memset(ctx, 0, sizeof(*ctx));
|
|
||||||
free(ctx->key);
|
free(ctx->key);
|
||||||
|
memset(ctx, 0, sizeof(*ctx));
|
||||||
free(ctx);
|
free(ctx);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user