Re: BUG #15378: SP-GIST memory context screwup?

Alexander Korotkov <a.korotkov@postgrespro.ru>

From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-bugs@lists.postgresql.org, Teodor Sigaev <teodor@sigaev.ru>
Date: 2018-09-11T21:26:54Z
Lists: pgsql-bugs
On Tue, Sep 11, 2018 at 6:47 PM Andrew Gierth <andrew@tao11.riddles.org.uk>
wrote:

> But it turns out that removing the pfree will cause transient leakage
> within the scan, since ScanStackEntry objects are also freed retail
> during a walk. ugh.
>

Right, I've missed code path freeScanStackEntry() call from spgWalk().

On Tue, Sep 11, 2018 at 9:59 PM Andrew Gierth <andrew@tao11.riddles.org.uk>
wrote:

>  Andrew> Proposed patch attached.
>
> Pushed this.
>

Pushed version looks correct to me.  Thank you!

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Repair double-free in SP-GIST rescan (bug #15378)