The call to full_path_tos() might allocate memory which needs to be free'd
once processign is done.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
/*
* Filter files above dirpath
*/
- return 0;
+ goto out;
}
if (fullpath[state->dirpath_len] != '/') {
/*
* Filter file that don't have a path separator at the end of
* dirpath's length
*/
- return 0;
+ goto out;
}
if (memcmp(state->dirpath, fullpath, state->dirpath_len) != 0) {
/*
* Not a parent
*/
- return 0;
+ goto out;
}
+ TALLOC_FREE(to_free);
return state->fn(fid, data, state->private_data);
+
+out:
+ TALLOC_FREE(to_free);
+ return 0;
}
static int files_below_forall(connection_struct *conn,