From: | "Brendan Jurd" <direvus(at)gmail(dot)com> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Uncleared result sets in describeOneTableDetails() |
Date: | 2006-11-07 06:56:08 |
Message-ID: | 37ed240d0611062256t2f3e6d8aka79fd9b0e05b6cde@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 11/7/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> > Is it crucial that result sets be cleared before going out of scope?
>
> It sounds like it'd leak memory inside psql; but realistically that's
> probably not an enormous problem for this usage. How much uglification
> of the code are we talking about to fix it?
>
Should be just six extra lines (patch attached, untested). This isn't
really an uglification of the code, so much as bringing this
particular code segment into line with the existing ugliness standard
of the rest of the function. =)
It certainly isn't pretty. It's been a long time since I looked down
the barrel of a 'goto'. This sort of thing feels like it should be
dealt with by RAII or try/catch, but this is C we're talking about.
It's hard to do things gracefully.
Regards,
BJ
Attachment | Content-Type | Size |
---|---|---|
describe.c.diff | application/octet-stream | 623 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2006-11-07 09:51:21 | Block B-tree etc. (was Re: Introducing an advanced Frequent Update) |
Previous Message | Tom Lane | 2006-11-07 06:10:46 | Re: Uncleared result sets in describeOneTableDetails() |