Skip to content

Commit

Permalink
Prevent double free of RC4 context
Browse files Browse the repository at this point in the history
Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed Apr 16, 2019
1 parent 9c4ee5d commit ca6c587
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/digestmd5.c
Expand Up @@ -1224,8 +1224,14 @@ static void free_rc4(context_t *text)
{
/* free rc4 context structures */

if(text->cipher_enc_context) text->utils->free(text->cipher_enc_context);
if(text->cipher_dec_context) text->utils->free(text->cipher_dec_context);
if (text->cipher_enc_context) {
text->utils->free(text->cipher_enc_context);
text->cipher_enc_context = NULL;
}
if (text->cipher_dec_context) {
text->utils->free(text->cipher_dec_context);
text->cipher_dec_context = NULL;
}
}

static int init_rc4(context_t *text,
Expand Down

0 comments on commit ca6c587

Please sign in to comment.