BUG/MINOR: connections: Make sure we free the connection on failure.
authorOlivier Houchard <cognet@ci0.org>
Fri, 20 Mar 2020 13:26:32 +0000 (14:26 +0100)
committerOlivier Houchard <cognet@ci0.org>
Fri, 20 Mar 2020 13:35:07 +0000 (14:35 +0100)
commitc0caac2cc8f51c5802f0128a4ceb0c73ff601ead
treee76912be64d7ca70e386e2b817557071838cd452
parent67b991d370108f44a88143851f904d78f84a3842
BUG/MINOR: connections: Make sure we free the connection on failure.

In connect_server(), make sure we properly free a newly created connection
if we somehow fail, and it has not yet been attached to a conn_stream, or
it would lead to a memory leak.
This should appease coverity for backend.c, as reported in inssue #556.

This should be backported to 2.1, 2.0 and 1.9
src/backend.c