Fix memory leak in Nettle crypto backend.

This commit is contained in:
Milan Broz
2014-02-05 17:17:55 +01:00
parent cf534f3759
commit ad2f50316f

View File

@@ -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)
{
memset(ctx->key, 0, ctx->key_length);
memset(ctx, 0, sizeof(*ctx));
free(ctx->key);
memset(ctx, 0, sizeof(*ctx));
free(ctx);
return 0;
}