Skip to content

Commit

Permalink
Merge pull request #562 from simo5/rc4doublefree
Browse files Browse the repository at this point in the history
Prevent double free of RC4 context
  • Loading branch information
ksmurchison authored Apr 17, 2019
2 parents 9c4ee5d + ca6c587 commit 284be6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/digestmd5.c
Original file line number Diff line number Diff line change
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 284be6f

Please sign in to comment.