Prevent memory leaks in our various bison parsers when an error occurs

Tom Lane <tgl@sss.pgh.pa.us>

Commit: fbb2b69c8f478c2910a32e25d80eaf67d0dd3cbf
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-09-02T20:37:55Z
Releases: 8.4.0
Prevent memory leaks in our various bison parsers when an error occurs
during parsing.  Formerly the parser's stack was allocated with malloc
and so wouldn't be reclaimed; this patch makes it use palloc instead,
so that flushing the current context will reclaim the memory.  Per
Marko Kreen.

Files

PathChange+/−
contrib/cube/cubeparse.y modified +12 −1
contrib/seg/segparse.y modified +11 −0
src/backend/bootstrap/bootparse.y modified +12 −1
src/backend/parser/gram.y modified +12 −1
src/pl/plpgsql/src/gram.y modified +13 −1