From fec300b0c1efeb95f504bc3d1fdbb47f88f76d23 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 16 Jul 2015 15:01:09 +0200 Subject: [PATCH] vfs: Consolidate failure paths in vfswrap_init_asys_ctx Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Jul 17 01:35:33 CEST 2015 on sn-devel-104 --- source3/modules/vfs_default.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 1c29cb4c79d..490c4ab2039 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -707,9 +707,7 @@ static bool vfswrap_init_asys_ctx(struct smbd_server_connection *conn) ret = set_blocking(fd, false); if (ret != 0) { DBG_WARNING("set_blocking failed: %s\n", strerror(ret)); - asys_context_destroy(conn->asys_ctx); - conn->asys_ctx = NULL; - return false; + goto fail; } conn->asys_fde = tevent_add_fd(conn->ev_ctx, conn, fd, @@ -718,11 +716,14 @@ static bool vfswrap_init_asys_ctx(struct smbd_server_connection *conn) conn->asys_ctx); if (conn->asys_fde == NULL) { DEBUG(1, ("tevent_add_fd failed\n")); - asys_context_destroy(conn->asys_ctx); - conn->asys_ctx = NULL; - return false; + goto fail; } return true; + +fail: + asys_context_destroy(conn->asys_ctx); + conn->asys_ctx = NULL; + return false; } struct vfswrap_asys_state { -- 2.11.4.GIT