The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
We observe a memory leak while executing a PGSql statement from a session. Below is the stack trace captured using Valgrind.
218591 ==72266== by 0x9B16458: QR_Constructor (qresult.c:138)
218592 ==72266== by 0x9B2A8E1: SC_pre_execute (statement.c:1099)
218593 ==72266== by 0x9B21232: SC_pre_execute_ok (results.c:96)
218594 ==72266== by 0x9B22AA5: PGAPI_NumResultCols (results.c:193)
218595 ==72266== by 0x9B35600: SQLNumResultCols (odbcapi.c:618)
218596 ==72266== by 0x9078511: SQLNumResultCols (SQLNumResultCols.c:220)
218597 ==72266== by 0x37EC234: Poco::Data::ODBC::Preparation::Preparation(Poco::Data::ODBC::Handle<void*, (short)3> const&, std::string const&, unsigned long, Poco::Data: :ODBC::Preparation::DataExtraction) (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoDataODBC.so.16)
218598 ==72266== by 0x37E7263: Poco::Data::ODBC::ODBCStatementImpl::compileImpl() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoDataODBC.so.16)
218599 ==72266== by 0x36A7527: Poco::Data::StatementImpl::compile() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoData.so.16)
218600 ==72266== by 0x36A75B8: Poco::Data::StatementImpl::executeWithoutLimit() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoData.so.16)
218601 ==72266== by 0x36A7907: Poco::Data::StatementImpl::execute() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoData.so.16)
We observe a memory leak while executing a PGSql statement from a session. Below is the stack trace captured using Valgrind.
218591 ==72266== by 0x9B16458: QR_Constructor (qresult.c:138) 218592 ==72266== by 0x9B2A8E1: SC_pre_execute (statement.c:1099) 218593 ==72266== by 0x9B21232: SC_pre_execute_ok (results.c:96) 218594 ==72266== by 0x9B22AA5: PGAPI_NumResultCols (results.c:193) 218595 ==72266== by 0x9B35600: SQLNumResultCols (odbcapi.c:618) 218596 ==72266== by 0x9078511: SQLNumResultCols (SQLNumResultCols.c:220) 218597 ==72266== by 0x37EC234: Poco::Data::ODBC::Preparation::Preparation(Poco::Data::ODBC::Handle<void*, (short)3> const&, std::string const&, unsigned long, Poco::Data: :ODBC::Preparation::DataExtraction) (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoDataODBC.so.16) 218598 ==72266== by 0x37E7263: Poco::Data::ODBC::ODBCStatementImpl::compileImpl() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoDataODBC.so.16) 218599 ==72266== by 0x36A7527: Poco::Data::StatementImpl::compile() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoData.so.16) 218600 ==72266== by 0x36A75B8: Poco::Data::StatementImpl::executeWithoutLimit() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoData.so.16) 218601 ==72266== by 0x36A7907: Poco::Data::StatementImpl::execute() (in /var/mps64/main/ion_55_5_nmx/usr.src/sdx/mps/install/lib/libPocoData.so.16)
Below is the code of how it is being invoked.
Please acknowledge with your observations.