Re: using worker_spi as pattern

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: using worker_spi as pattern
Date: 2018-03-09 06:34:19
Message-ID: 20180309063419.GA9376@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2018-03-09 06:54:27 Re: public schema default ACL
Previous Message Gasper Zejn 2018-03-09 06:17:37 Re: disable SSL compression?