From 24e437041487a198057c02a1dd60c78d024af11f Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 29 Nov 2021 13:41:09 +0100 Subject: [PATCH] Close leak of QOCIDateTime object Noticed while reviewing usage of this type. The code has a whole TempStorage class to take care of keeping allocated memory live until we're done with it, explicitly including date-time objects as a special case, but neglected to use it in one place. Pick-to: 6.2 5.15 Change-Id: Ic94c56d67dda6dc3ee36a025a2e0149f6b2a1837 Reviewed-by: Andy Shaw --- src/plugins/sqldrivers/oci/qsql_oci.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index b0f68c0d09d..b395c41d0f3 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -1497,6 +1497,7 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVariantList &boundValues, bool a columns[i].lengths[row] = columns[i].maxLen; QOCIDateTime *date = new QOCIDateTime(d->env, d->err, val.toDateTime()); *reinterpret_cast(dataPtr) = date->dateTime; + tmpStorage.dateTimes.append(date); break; } case QMetaType::Int: