-
- Downloads
Fix Memory leaks when using TPgSQLStatement. See JIRA ROOT-5393
when recently valgrinding our analysis-software again, I found two leaks stemming from lost pointers to prepared PgSQL-statements in TPgSQLStatement (we just started using the TSQLStatement more often some weeks ago). The problem is that the TPgSQLServer already prepares a PGresult and adds a pointer to it to the stmt-structure which is passed to TPgSQLStatement. The TPgSQLStatement creates a new prepared statement in its constructor and overrides this pointer with it. In TPgSQLStatement:Process(), this pointer is overwritten again. To not break any existing usecases of this, the attached patch fixes this problem by first PQclear'ing the prepared result if it is not NULL. This fixes both leaks (and at the moment, I do not observe more leaks in our usage of the TPgSQLStatement). [From Oliver Freyermuth]
Please register or sign in to comment