Prevent memory leaks in our various bison parsers when an error occurs
Tom Lane <tgl@sss.pgh.pa.us>
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
| Path | Change | +/− |
|---|---|---|
| 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 |