From 382237eae1e143f60da9a4424992327c89a89b10 Mon Sep 17 00:00:00 2001
From: Nitin <nitin.jadhav@enterprisedb.com>
Date: Tue, 18 May 2021 22:43:58 +0530
Subject: [PATCH 5/5] create_range_bounds-pfree-intermediate-results

---
 src/backend/partitioning/partbounds.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index f1a692c..67a0fce 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -715,6 +715,8 @@ create_range_bounds(PartitionBoundSpec **boundspecs, int nparts,
 		prev = cur;
 	}
 
+	pfree(all_bounds);
+
 	/* Update ndatums to hold the count of distinct datums. */
 	ndatums = k;
 
@@ -781,6 +783,8 @@ create_range_bounds(PartitionBoundSpec **boundspecs, int nparts,
 		}
 	}
 
+	pfree(rbounds);
+
 	/* Set the canonical value for default_index, if any. */
 	if (default_index != -1)
 	{
-- 
1.8.3.1

