Re: Missing pfree in logical_heap_rewrite_flush_mappings() - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Missing pfree in logical_heap_rewrite_flush_mappings()
Date
Msg-id 20140423081123.GH4449@awork2.anarazel.de
Whole thread Raw
In response to Re: Missing pfree in logical_heap_rewrite_flush_mappings()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2014-04-22 22:37:37 -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I had to revert this patch.  It causes a failure in the
> > /contrib/test_decoding regression test.
> 
> On closer inspection, it was simply pfree'ing the wrong pointer.

Thanks for fixing.

> I fixed that and also undid the allocation in a different memory
> context, which didn't seem to be a particularly good idea, unless
> you've got a specific reason why CurrentMemoryContext would be the
> wrong place for a transient allocation.

That should be fine. I don't see any reason not to use palloc.
logical_rewrite_log_mapping() has to allocate longer living memory, I
guess it was copied from there.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: What use case is make_tuple_indirect() supposed to illustrate?
Next
From: Petr Jelinek
Date:
Subject: Re: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)