From d7c45172a673be1fc9e51e98e45a44c14d1ee78d Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Thu, 8 Sep 2016 11:20:21 +0100 Subject: [PATCH] Fix minor memory leak in Standby startup StandbyRecoverPreparedTransactions() leaked the buffer used for two phase state file. This was leaked once at startup and at every shutdown checkpoint seen. Backpatch to 9.6 Stas Kelvich --- src/backend/access/transam/twophase.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 9f55adcaf5..1323fb508d 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -1886,6 +1886,8 @@ StandbyRecoverPreparedTransactions(bool overwriteOK) Assert(TransactionIdFollows(subxid, xid)); SubTransSetParent(xid, subxid, overwriteOK); } + + pfree(buf); } } FreeDir(cldir); -- 2.40.0