Skip to content

Commit

Permalink
#207: Resource leak (in not_code_range_buf())
Browse files Browse the repository at this point in the history
  • Loading branch information
kkos committed Sep 21, 2020
1 parent 2493154 commit 2f49376
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/regparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3880,13 +3880,17 @@ not_code_range_buf(OnigEncoding enc, BBuf* bbuf, BBuf** pbuf)
to = data[i*2+1];
if (pre <= from - 1) {
r = add_code_range_to_buf(pbuf, pre, from - 1);
if (r != 0) return r;
if (r != 0) {
bbuf_free(*pbuf);
return r;
}
}
if (to == ~((OnigCodePoint )0)) break;
pre = to + 1;
}
if (to < ~((OnigCodePoint )0)) {
r = add_code_range_to_buf(pbuf, to + 1, ~((OnigCodePoint )0));
if (r != 0) bbuf_free(*pbuf);
}
return r;
}
Expand Down

0 comments on commit 2f49376

Please sign in to comment.