From: Jeremy Allison Date: Mon, 7 Jun 2021 16:21:55 +0000 (-0700) Subject: s3: smbd: rmdir_internals(). Coding cleanup. Move TALLOC_FREE(dir_hnd) into the gener... X-Git-Tag: tevent-0.11.0~633 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92d143dbcb80fda46894f514d04d8f40c0c935c7;p=thirdparty%2Fsamba.git 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 --- 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) {