Re: using worker_spi as pattern - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: using worker_spi as pattern
Date
Msg-id 20180309063419.GA9376@paquier.xyz
Whole thread Raw
In response to Re: using worker_spi as pattern  (Jeremy Finzel <finzelj@gmail.com>)
Responses Re: using worker_spi as pattern  (Jeremy Finzel <finzelj@gmail.com>)
List pgsql-hackers
On Thu, Mar 08, 2018 at 11:04:20PM -0600, Jeremy Finzel wrote:
> Since you mention, can anyone elaborate further on the memory leak danger
> here?
>
> Line 193 in src/test/modules/worker_spi/worker_spi.c read:
> # Note some memory might be leaked here.
>
> Is this any reason *not *to use this pattern in production?

quote_identifier may palloc the result, so the first pstrdup on the top
to save "schema" and "table" refer to a pointer which may perhaps get
lost.  Those are just a couple of bytes, so the code complication is not
worth the cleanup IMO.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Gasper Zejn
Date:
Subject: Re: disable SSL compression?
Next
From: Noah Misch
Date:
Subject: Re: public schema default ACL