Simon Brooke <simon@weft.co.uk> writes:
> curr_conn = result->conn;
> if ((curr_conn == NULL) && (pgTypeRes==0)) {
Get rid of curr_conn and the ensuing test on same, is my advice.
This code should never have been reaching inside PGresult to begin
with...
regards, tom lane