Fix read-after-free bug in error handler.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 21 Jan 2015 16:44:52 +0000 (18:44 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 21 Jan 2015 16:47:30 +0000 (18:47 +0200)
commit38ec5b0b0f00e24dd6e46be29e64001f48da874f
treeefaba96c34f55303a55ad39b70da5867a0ae16ea
parent085e9324eb5a592f3b73f594311819cbf8dc5f2d
Fix read-after-free bug in error handler.

If a connection dies, CC_on_abort() calls PQfinish() which frees the error
message. handle_pgres_error better deal with the error message before
calling CC_on_abort().

Spotted by valgrind, on the "diagnostic" regression test.
connection.c