From 9022b7f8fe0aaaf4ad000233f6ef37cd0e0f9427 Mon Sep 17 00:00:00 2001 From: Jan Wieck Date: Wed, 29 Jan 2014 12:11:57 -0500 Subject: [PATCH] logApply trigger free()s data from wrong cache entry on evict. --- src/backend/slony1_funcs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/slony1_funcs.c b/src/backend/slony1_funcs.c index 506b6f90..933cbe48 100644 --- a/src/backend/slony1_funcs.c +++ b/src/backend/slony1_funcs.c @@ -1782,10 +1782,13 @@ versionFunc(logApply)(PG_FUNCTION_ARGS) SPI_freeplan(evict->plan); oldContext = MemoryContextSwitchTo(applyCacheContext); - pfree(cacheEnt->finfo_input); - pfree(cacheEnt->typioparam); - pfree(cacheEnt->typmod); + pfree(evict->finfo_input); + pfree(evict->typioparam); + pfree(evict->typmod); MemoryContextSwitchTo(oldContext); + evict->finfo_input = NULL; + evict->typioparam = NULL; + evict->typmod = NULL; evict->plan = NULL; #ifdef APPLY_CACHE_VERIFY evict->evicted = 1; -- 2.39.5