summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--plugins/ompgsql/ompgsql.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ec115b0e..7a06dc93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------
+Version 2.0.7 V2-STABLE (rgerhards), 2008-??-??
+- bugfix: memory leak in ompgsql
+ Thanks to Ken for providing the patch
+---------------------------------------------------------------------------
Version 2.0.6 V2-STABLE (rgerhards), 2008-??-??
- bugfix: memory leaks in rsyslogd, primarily in singlethread mode
Thanks to Frederico Nunez for providing the fix
diff --git a/plugins/ompgsql/ompgsql.c b/plugins/ompgsql/ompgsql.c
index 24a68a5f..db48982b 100644
--- a/plugins/ompgsql/ompgsql.c
+++ b/plugins/ompgsql/ompgsql.c
@@ -177,12 +177,12 @@ rsRetVal writePgSQL(uchar *psz, instanceData *pData)
dbgprintf("writePgSQL: %s", psz);
/* try insert */
- PQexec(pData->f_hpgsql, (char*)psz);
+ PQclear(PQexec(pData->f_hpgsql, (char*)psz));
if(PQstatus(pData->f_hpgsql) != CONNECTION_OK) {
/* error occured, try to re-init connection and retry */
closePgSQL(pData); /* close the current handle */
CHKiRet(initPgSQL(pData, 0)); /* try to re-open */
- PQexec(pData->f_hpgsql, (char*)psz);
+ PQclear(PQexec(pData->f_hpgsql, (char*)psz));
if(PQstatus(pData->f_hpgsql) != CONNECTION_OK) { /* re-try insert */
/* we failed, giving up for now */
reportDBError(pData, 0);