]> granicus.if.org Git - postgresql/commit
Fix memory leak in pgbench
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 9 Apr 2019 16:46:34 +0000 (12:46 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 9 Apr 2019 16:46:34 +0000 (12:46 -0400)
commitfe0e0b4fc7f0cdc2333bda08b199422a1e77a551
treede4c2e661629a89fecbde874728020c30e1d0955
parenta2418f9e238794fcaaf00bbd5b8f953ca2856aa0
Fix memory leak in pgbench

Commit 25ee70511ec2 introduced a memory leak in pgbench: some PGresult
structs were not being freed during error bailout, because we're now
doing more PQgetResult() calls than previously.  Since there's more
cleanup code outside the discard_response() routine than in it, refactor
the cleanup code, removing the routine.

This has little effect currently, since we abandon processing after
hitting errors, but if we ever get further pgbench features (such as
testing for serializable transactions), it'll matter.

Per Coverity.

Reviewed-by: Michaƫl Paquier
src/bin/pgbench/pgbench.c