Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x
Michael Paquier <michael.paquier@gmail.com>
From: Michael Paquier <michael.paquier@gmail.com>
To: Bill Parker <wp02855@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Date: 2015-06-12T07:05:44Z
Lists: pgsql-bugs
Attachments
- 20150612_pltcl_oom.patch (text/x-diff) patch
On Fri, Jun 12, 2015 at 4:22 AM, Bill Parker wrote: > In reviewing some code, in directory 'postgresql-9.4.3/src/pl/tcl', > file 'pltcl.c', there are several instances where calls to malloc() > are made, but no check for a return value of NULL is made, which > would indicate failure. Additionally, it appears when malloc() > returns NULL, previously allocated memory in function 'perm_fmgr_info' > is not released, which could lead to memory leaks (even though the > comment at the top says 'this routine is a crock' :) > > If you know how this problem might be fixed, list the solution below: > Please feel free to review and comment on the above patch file... Oh, nice catch again. > I am attaching the patch file to this bug report By the way, your patch does not compile properly and is not in-line with the project's code format. See the updated patch attached ;) -- Michael
Commits
-
Fix (some of) pltcl memory usage
- b2efbb71dfb4 9.3.10 landed
- b0b6f8d71f03 9.5.0 landed
- 4c11967e7348 9.0.23 landed
- 49c30004073f 9.4.5 landed
- 3cb6ef9983b5 9.2.14 landed
- 14ade020ffa8 9.1.19 landed
- f8d67ca8d4cb 9.6.0 landed