]> granicus.if.org Git - postgresql/commit
Fix (some of) pltcl memory usage
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 20 Jul 2015 12:18:08 +0000 (14:18 +0200)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 20 Jul 2015 12:18:08 +0000 (14:18 +0200)
commit4c11967e7348b79a27738a6f714d61325c660c5b
treefeb350b5f6606ede0e59f934a5511a1330d55642
parentcdf596b1ceb6193ab6c1e24c57531423243fce4b
Fix (some of) pltcl memory usage

As reported by Bill Parker, PL/Tcl did not validate some malloc() calls
against NULL return.  Fix by using palloc() in a new long-lived memory
context instead.  This allows us to simplify error handling too, by
simply deleting the memory context instead of doing retail frees.

There's still a lot that could be done to improve PL/Tcl's memory
handling ...

This is pretty ancient, so backpatch all the way back.

Author: Michael Paquier and Álvaro Herrera
Discussion: https://www.postgresql.org/message-id/CAFrbyQwyLDYXfBOhPfoBGqnvuZO_Y90YgqFM11T2jvnxjLFmqw@mail.gmail.com
src/pl/tcl/pltcl.c