Blame SOURCES/DBD-Pg-3.6.0-Always-clear-out-libpq-results-before-reassigning-fi.patch

70392c
From 8ca0f67807848143470178fb535ea53cdcd8aad2 Mon Sep 17 00:00:00 2001
70392c
From: Mike Magin <mmagin@arubanetworks.com>
70392c
Date: Tue, 4 Apr 2017 11:16:10 -0400
70392c
Subject: [PATCH] Always clear out libpq results before reassigning: fixes leak
70392c
 in putcopyend
70392c
70392c
---
70392c
 dbdimp.c | 2 ++
70392c
 1 file changed, 2 insertions(+)
70392c
70392c
diff --git a/dbdimp.c b/dbdimp.c
70392c
index aab8cc9..dfc2173 100644
70392c
--- a/dbdimp.c
70392c
+++ b/dbdimp.c
70392c
@@ -3892,6 +3892,7 @@ int pg_db_getcopydata (SV * dbh, SV * dataline, int async)
70392c
 		result = PQgetResult(imp_dbh->conn);
70392c
 		status = _sqlstate(aTHX_ imp_dbh, result);
70392c
 		while (result != NULL) {
70392c
+                  	PQclear(result);
70392c
 			result = PQgetResult(imp_dbh->conn);
70392c
 		}
70392c
 		TRACE_PQCLEAR;
70392c
@@ -3986,6 +3987,7 @@ int pg_db_putcopyend (SV * dbh)
70392c
 		result = PQgetResult(imp_dbh->conn);
70392c
 		status = _sqlstate(aTHX_ imp_dbh, result);
70392c
 		while (result != NULL) {
70392c
+                  	PQclear(result);
70392c
 			result = PQgetResult(imp_dbh->conn);
70392c
 		}
70392c
 		TRACE_PQCLEAR;
70392c
-- 
70392c
2.31.1
70392c