From 92d143dbcb80fda46894f514d04d8f40c0c935c7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 7 Jun 2021 09:21:55 -0700 Subject: [PATCH] s3: smbd: rmdir_internals(). Coding cleanup. Move TALLOC_FREE(dir_hnd) into the generic exit path. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/close.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index e066d3a697c..3cae46f039f 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1065,7 +1065,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) continue; } if (!IS_VETO_PATH(conn, dname)) { - TALLOC_FREE(dir_hnd); TALLOC_FREE(talloced); errno = ENOTEMPTY; goto err; @@ -1077,7 +1076,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) * Are we allowed to delete them ? */ if (!lp_delete_veto_files(SNUM(conn))) { - TALLOC_FREE(dir_hnd); errno = ENOTEMPTY; goto err; } @@ -1188,9 +1186,10 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) at_fname, AT_REMOVEDIR); - TALLOC_FREE(dir_hnd); err: + + TALLOC_FREE(dir_hnd); TALLOC_FREE(parent_fname); if (ret != 0) { -- 2.47.3