Skip to content

Commit

Permalink
Fix mem leak in b2g.
Browse files Browse the repository at this point in the history
  • Loading branch information
poona committed Sep 29, 2013
1 parent 06db1e4 commit fc82614
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util-mpm-b2g.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ void B2gFreePattern(MpmCtx *mpm_ctx, B2gPattern *p) {
mpm_ctx->memory_size -= p->len;
}

if (p != NULL && p->original_pat != NULL) {
SCFree(p->original_pat);
mpm_ctx->memory_cnt--;
mpm_ctx->memory_size -= p->len;
}

if (p) {
SCFree(p);
mpm_ctx->memory_cnt--;
Expand Down

0 comments on commit fc82614

Please sign in to comment.