[DBD::Pg 1/2] Mortalize internal string created when expanding arrays. Helps but does not completely fix recent memory leak report.

[email protected] Mon, 3 Nov 2014 16:04:13 +0000
Newsgroups perl.dbd.pg.changes
Message-ID <[email protected]>
Committed by Greg Sabino Mullane <[email protected]>

Subject: [DBD::Pg 1/2] Mortalize internal string created when expanding
arrays. Helps but does not completely fix recent memory leak report.

---
 dbdimp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dbdimp.c b/dbdimp.c
index 40c62fa..28882a5 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -2833,6 +2833,7 @@ static SV * pg_destringify_array(pTHX_ imp_dbh_t *imp_dbh, unsigned char * input
 					}
 
 					SV *sv = newSVpvn(string, section_size);
+					sv_2mortal(sv);
 
 					// Mark as utf8 if needed (but never bytea)
 					if (0 != strncmp(coltype->type_name, "_bytea", 6)
-- 
1.8.4