]> granicus.if.org Git - postgresql/commitdiff
Fix minor memory leak in Standby startup
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 8 Sep 2016 10:20:21 +0000 (11:20 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 8 Sep 2016 10:20:21 +0000 (11:20 +0100)
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

index 9f55adcaf5ef0e50fe1ea93e4e725c5c7b794215..1323fb508dc9585e8366dcc8f24ed8fe88fcee46 100644 (file)
@@ -1886,6 +1886,8 @@ StandbyRecoverPreparedTransactions(bool overwriteOK)
                                Assert(TransactionIdFollows(subxid, xid));
                                SubTransSetParent(xid, subxid, overwriteOK);
                        }
+
+                       pfree(buf);
                }
        }
        FreeDir(cldir);