1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:ctdbd_conn: make sure ctdbd_init_async_connection() never returns 0 with conn = NULL

This should not happen anywhere, but it clears the expectation of the
caller and simplifies the error handling there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-06-13 11:32:30 +02:00 committed by Jeremy Allison
parent b609734c52
commit c5ef91865d

View File

@ -538,6 +538,8 @@ int ctdbd_init_async_connection(
struct ctdbd_connection *conn = NULL;
int ret;
*pconn = NULL;
ret = ctdbd_init_connection(mem_ctx, sockname, timeout, &conn);
if (ret != 0) {
return ret;
@ -546,6 +548,7 @@ int ctdbd_init_async_connection(
ret = set_blocking(conn->fd, false);
if (ret == -1) {
int err = errno;
SMB_ASSERT(err != 0);
TALLOC_FREE(conn);
return err;
}