]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: rmdir_internals(). Coding cleanup. Move TALLOC_FREE(dir_hnd) into the gener...
authorJeremy Allison <jra@samba.org>
Mon, 7 Jun 2021 16:21:55 +0000 (09:21 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/close.c

index e066d3a697c4bb2725e7e68285fa574c9c023582..3cae46f039fda102edaf02097b202e26d6ac35e9 100644 (file)
@@ -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) {