Committed by =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <[email protected]>

Mortalise destringifed arrayref before sv_setsv()

sv_setsv copies the reference, so we need to make sure the original one
gets freed and we don't leak the array
---
 dbdimp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dbdimp.c b/dbdimp.c
index 40c62fa..022058b 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -3648,7 +3648,7 @@ AV * dbd_st_fetch (SV * sth, imp_sth_t * imp_sth)
                        if (type_info
                                && 0 == strncmp(type_info->arrayout, "array", 5)
                                && imp_dbh->expand_array) {
-                               sv_setsv(sv, pg_destringify_array(aTHX_ 
imp_dbh, value, type_info));
+                               sv_setsv(sv, 
sv_2mortal(pg_destringify_array(aTHX_ imp_dbh, value, type_info)));
                        }
                        else {
                                if (type_info) {
-- 
1.8.4

Reply via email to