From: Stefan Metzmacher Date: Mon, 13 Jun 2022 09:32:30 +0000 (+0200) Subject: s3:ctdbd_conn: make sure ctdbd_init_async_connection() never returns 0 with conn... X-Git-Tag: tevent-0.13.0~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5ef91865d49c516a272a91eb35d20b23838a5ce;p=thirdparty%2Fsamba.git 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 --- 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; }