diff -urN flow-tools-0.67.orig/src/flow-export.c flow-tools-0.67/src/flow-export.c --- flow-tools-0.67.orig/src/flow-export.c 2005-01-27 01:07:05.203972288 -0500 +++ flow-tools-0.67/src/flow-export.c 2005-01-27 01:08:26.509611952 -0500 @@ -937,6 +937,8 @@ if (!res || PQresultStatus(res) != PGRES_COMMAND_OK) { PQclear(res); fterr_errx(1,"PQexec(): %s\n", PQerrorMessage(conn)); + } else if (res) { + PQclear(res); } }