TALLOC_CTX *ctx = talloc_stackframe();
NTSTATUS status = NT_STATUS_OK;
- if (strequal(finfo->name,"..") || strequal(finfo->name,"."))
- return NT_STATUS_OK;
+ if (strequal(finfo->name,"..") || strequal(finfo->name,".")) {
+ status = NT_STATUS_OK;
+ goto cleanup;
+ }
/* Is it on the exclude list ? */
if (!tar_excl && clipn) {
client_get_cur_dir(),
finfo->name);
if (!exclaim) {
- return NT_STATUS_NO_MEMORY;
+ status = NT_STATUS_NO_MEMORY;
+ goto cleanup;
}
DEBUG(5, ("...tar_re_search: %d\n", tar_re_search));
(tar_re_search && mask_match_list(exclaim, cliplist, clipn, True))) {
DEBUG(3,("Skipping file %s\n", exclaim));
TALLOC_FREE(exclaim);
- return NT_STATUS_OK;
+ status = NT_STATUS_OK;
+ goto cleanup;
}
TALLOC_FREE(exclaim);
}
saved_curdir = talloc_strdup(ctx, client_get_cur_dir());
if (!saved_curdir) {
- return NT_STATUS_NO_MEMORY;
+ status = NT_STATUS_NO_MEMORY;
+ goto cleanup;
}
DEBUG(5, ("strlen(cur_dir)=%d, \
client_get_cur_dir(),
finfo->name);
if (!new_cd) {
- return NT_STATUS_NO_MEMORY;
+ status = NT_STATUS_NO_MEMORY;
+ goto cleanup;
}
client_set_cur_dir(new_cd);
"%s*",
client_get_cur_dir());
if (!mtar_mask) {
- return NT_STATUS_NO_MEMORY;
+ status = NT_STATUS_NO_MEMORY;
+ goto cleanup;
}
DEBUG(5, ("Doing list with mtar_mask: %s\n", mtar_mask));
do_list(mtar_mask, attribute, do_tar, False, True);
client_get_cur_dir(),
finfo->name);
if (!rname) {
- return NT_STATUS_NO_MEMORY;
+ status = NT_STATUS_NO_MEMORY;
+ goto cleanup;
}
status = do_atar(rname,finfo->name,finfo);
TALLOC_FREE(rname);
}
+
+ cleanup:
+ TALLOC_FREE(ctx);
return status;
}