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.
mylog("notice/error message len=%d\n", strlen(errmsg));
- if (0 != abort_opt
-#ifdef _LEGACY_MODE_
- || TRUE
-#endif /* _LEGACY_NODE_ */
- )
- CC_on_abort(self, abort_opt);
-
if (fatal)
{
if (res)
if (errmsg != errprimary)
free(errmsg);
+ if (0 != abort_opt
+#ifdef _LEGACY_MODE_
+ || TRUE
+#endif /* _LEGACY_NODE_ */
+ )
+ CC_on_abort(self, abort_opt);
+
LIBPQ_update_transaction_status(self);
}