Properly call PQFinish after failed connection attempts to stop leaking socket file descriptors
@@ -32,6 +32,9 @@ impl RawConnection {
}
_ => {
let message = last_error_message(connection_ptr);
+
+ unsafe { PQfinish(connection_ptr) }
+
Err(ConnectionError::BadConnection(message))
}
}
