From c5ef91865d49c516a272a91eb35d20b23838a5ce Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 13 Jun 2022 11:32:30 +0200 Subject: [PATCH] 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 Reviewed-by: Andrew Bartlett --- source3/lib/ctdbd_conn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 8fe94226590..dd9206b00fd 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -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; } -- 2.47.3