diff --git a/SOURCES/DBD-Pg-3.6.0-Always-clear-out-libpq-results-before-reassigning-fi.patch b/SOURCES/DBD-Pg-3.6.0-Always-clear-out-libpq-results-before-reassigning-fi.patch new file mode 100644 index 0000000..5aea8be --- /dev/null +++ b/SOURCES/DBD-Pg-3.6.0-Always-clear-out-libpq-results-before-reassigning-fi.patch @@ -0,0 +1,33 @@ +From 8ca0f67807848143470178fb535ea53cdcd8aad2 Mon Sep 17 00:00:00 2001 +From: Mike Magin +Date: Tue, 4 Apr 2017 11:16:10 -0400 +Subject: [PATCH] Always clear out libpq results before reassigning: fixes leak + in putcopyend + +--- + dbdimp.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dbdimp.c b/dbdimp.c +index aab8cc9..dfc2173 100644 +--- a/dbdimp.c ++++ b/dbdimp.c +@@ -3892,6 +3892,7 @@ int pg_db_getcopydata (SV * dbh, SV * dataline, int async) + result = PQgetResult(imp_dbh->conn); + status = _sqlstate(aTHX_ imp_dbh, result); + while (result != NULL) { ++ PQclear(result); + result = PQgetResult(imp_dbh->conn); + } + TRACE_PQCLEAR; +@@ -3986,6 +3987,7 @@ int pg_db_putcopyend (SV * dbh) + result = PQgetResult(imp_dbh->conn); + status = _sqlstate(aTHX_ imp_dbh, result); + while (result != NULL) { ++ PQclear(result); + result = PQgetResult(imp_dbh->conn); + } + TRACE_PQCLEAR; +-- +2.31.1 + diff --git a/SPECS/perl-DBD-Pg.spec b/SPECS/perl-DBD-Pg.spec index 3966cd6..0b7d98e 100644 --- a/SPECS/perl-DBD-Pg.spec +++ b/SPECS/perl-DBD-Pg.spec @@ -1,11 +1,12 @@ Name: perl-DBD-Pg Summary: A PostgreSQL interface for perl Version: 2.19.3 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ or Artistic Group: Development/Libraries Source0: http://search.cpan.org/CPAN/authors/id/T/TU/TURNSTEP/DBD-Pg-%{version}.tar.gz URL: http://search.cpan.org/dist/DBD-Pg/ +Patch0: DBD-Pg-3.6.0-Always-clear-out-libpq-results-before-reassigning-fi.patch BuildRequires: perl(Carp) BuildRequires: perl(constant) @@ -54,6 +55,7 @@ to PostgreSQL databases. %prep %setup -q -n DBD-Pg-%{version} +%patch0 -p1 # Move testme.tmp.pl into tests sub-package mv testme.tmp.pl t/ sed -i -e '/^testme.tmp.pl$/ s/^/t\//' MANIFEST @@ -87,6 +89,9 @@ make test %changelog +* Thu Nov 04 2021 Jitka Plesnikova - 2.19.3-5 +- Always clear out libpq results before reassigning (rhbz #2020111) + * Fri Jan 24 2014 Daniel Mach - 2.19.3-4 - Mass rebuild 2014-01-24