summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-07-18 13:00:27 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-07-18 13:00:39 -0400
commit4a66f0f2d5a758f282549555feec4541c35588c4 (patch)
tree8a18d61c50cf1339e6b80394fbd1611cc8eac43b /src/backend/parser/parse_expr.c
parent9fb149573dee5dc0b2849b4cdee5d5ffe83313d9 (diff)
Fix two low-probability memory leaks in regular expression parsing.
If pg_regcomp failed after having invoked markst/cleanst, it would leak any "struct subre" nodes it had created. (We've already detected all regex syntax errors at that point, so the only likely causes of later failure would be query cancel or out-of-memory.) To fix, make sure freesrnode knows the difference between the pre-cleanst and post-cleanst cleanup procedures. Add some documentation of this less-than-obvious point. Also, newlacon did the wrong thing with an out-of-memory failure from realloc(), so that the previously allocated array would be leaked. Both of these are pretty low-probability scenarios, but a bug is a bug, so patch all the way back. Per bug #10976 from Arthur O'Dwyer.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
0 files changed, 0 insertions, 0 deletions