Re: Missing pfree in logical_heap_rewrite_flush_mappings()

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Ants Aasma <ants(at)cybertec(dot)at>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Missing pfree in logical_heap_rewrite_flush_mappings()
Date: 2014-03-27 12:19:05
Message-ID: 20140327121905.GH4582@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Andres Freund (andres(at)2ndquadrant(dot)com) wrote:
> On 2014-03-26 13:41:27 -0400, Stephen Frost wrote:
> > > Good catch. There's actually no need for explicitly using the context,
> > > we're in the appropriate one. The only other MemoryContextAlloc() caller
> > > in there should be converted to a palloc as well.
> >
> > Hrm..? I don't think that's right when it's called from
> > end_heap_rewrite().
>
> You're right. Apprently I shouldn't look at patches while watching a
> keynote ;)

No problem- but that's also why I was thinking we should just wrap
end_heap_rewrite() in a context as well, otherwise the next person who
comes along to add a bit of code here may end up making the same
mistake. Is there something you're concerned about there?

> > Perhaps we should be switching to state->rs_cxt
> > while in end_heap_rewrite() also though?
>
> I think just applying Aant's patch is fine.

I have no problem *also* doing the pfree() to address the concern about
the transient memory usage being more than we'd like.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2014-03-27 12:53:16 Re: inherit support for foreign tables
Previous Message Magnus Hagander 2014-03-27 12:07:54 Re: datistemplate of pg_database does not behave as per description in documentation