shadow_copy2: Add missing TALLOC_FREE
authorMikeLiu <mikeliu@qnap.com>
Fri, 13 Oct 2023 03:55:52 +0000 (11:55 +0800)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 17 Oct 2023 20:22:18 +0000 (20:22 +0000)
Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 17 20:22:18 UTC 2023 on atb-devel-224

source3/modules/vfs_shadow_copy2.c

index 8471d81c153e5b5a80be7afd844eb82e7712eb8b..ac87ddac46ff5117bdb7682810ad7f074edb42fc 100644 (file)
@@ -1580,9 +1580,12 @@ static int shadow_copy2_openat(vfs_handle_struct *handle,
                                                   &stripped,
                                                   &is_converted);
        if (!ok) {
+               TALLOC_FREE(smb_fname);
                return -1;
        }
        if (timestamp == 0) {
+               TALLOC_FREE(stripped);
+               TALLOC_FREE(smb_fname);
                if (is_converted) {
                        /*
                         * Just pave over the user requested mode and use
@@ -2386,6 +2389,7 @@ static int shadow_copy2_mkdirat(vfs_handle_struct *handle,
                                        full_fname,
                                        &timestamp,
                                        NULL)) {
+               TALLOC_FREE(full_fname);
                return -1;
        }
        TALLOC_FREE(full_fname);