summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 38b630c)
raw | patch | inline | side by side (parent: 38b630c)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 29 Nov 2012 08:01:37 +0000 (09:01 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 29 Nov 2012 08:01:37 +0000 (09:01 +0100) |
src/postgresql.c | patch | blob | history |
diff --git a/src/postgresql.c b/src/postgresql.c
index 15d4666b9eaf910c2d91f80ce2552291eb9d6e45..6c9ab44e8b3379aff58dd9b0b7a4295e6b74876c 100644 (file)
--- a/src/postgresql.c
+++ b/src/postgresql.c
if ((PGRES_COMMAND_OK != PQresultStatus (res))
&& (PGRES_TUPLES_OK != PQresultStatus (res))) {
+ PQclear (res);
+
if ((CONNECTION_OK != PQstatus (db->conn))
&& (0 == c_psql_check_connection (db))) {
- PQclear (res);
-
/* try again */
res = PQexecParams (db->conn, writer->statement,
STATIC_ARRAY_SIZE (params), NULL,
if ((PGRES_COMMAND_OK == PQresultStatus (res))
|| (PGRES_TUPLES_OK == PQresultStatus (res))) {
+ PQclear (res);
success = 1;
continue;
}
pthread_mutex_unlock (&db->db_lock);
return -1;
}
+
+ PQclear (res);
success = 1;
}