Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b3ee005

Browse files
committed
Fix segfault after unsuccessful connection attempt in libpq
1 parent ca48d54 commit b3ee005

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,14 @@ PQconnectPoll(PGconn *conn)
23302330
}
23312331
}
23322332
else
2333+
{
2334+
/*
2335+
* Set current address to the last address as it
2336+
* may be used later
2337+
*/
2338+
conn->whichaddr = conn->nconnaddr - 1;
23332339
break; /* Stop trying */
2340+
}
23342341
}
23352342

23362343
/*

0 commit comments

Comments
 (0)