s3: mdssvc: Correctly disconnect the VFS connection inside the mds_ctx destructor.
authorJeremy Allison <jra@samba.org>
Tue, 24 Aug 2021 00:40:42 +0000 (17:40 -0700)
committerJule Anger <janger@samba.org>
Mon, 6 Sep 2021 19:17:11 +0000 (19:17 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14809

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit b4d8c62c4e8191e05fd03dd096a0bc989e224ed3)

source3/rpc_server/mdssvc/mdssvc.c

index d0e87dcf646d7c841d32dde5e7ab7260deb4c344..fa31b55a183fd61b33e233ecd07ebb15e98048b8 100644 (file)
@@ -1569,6 +1569,11 @@ static int mds_ctx_destructor_cb(struct mds_ctx *mds_ctx)
        }
        TALLOC_FREE(mds_ctx->ino_path_map);
 
+       if (mds_ctx->conn != NULL) {
+               SMB_VFS_DISCONNECT(mds_ctx->conn);
+               conn_free(mds_ctx->conn);
+       }
+
        ZERO_STRUCTP(mds_ctx);
 
        return 0;