We have to return on talloc_tos() because we don't have a mem_ctx given to us.
So we have to create a separate temporary talloc context.
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Mar 14 19:21:11 CET 2011 on sn-devel-104
static const char *shadow_copy2_connectpath(struct vfs_handle_struct *handle,
const char *fname)
{
static const char *shadow_copy2_connectpath(struct vfs_handle_struct *handle,
const char *fname)
{
- TALLOC_CTX *tmp_ctx = talloc_stackframe();
const char *snapdir, *baseoffset, *basedir, *gmt_start;
size_t baselen;
char *ret;
const char *snapdir, *baseoffset, *basedir, *gmt_start;
size_t baselen;
char *ret;
return handle->conn->connectpath;
}
return handle->conn->connectpath;
}
- fname = shadow_copy2_normalise_path(talloc_tos(), fname, gmt_start);
+ /*
+ * We have to create a real temporary context because we have
+ * to put our result on talloc_tos(). Thus we can't use a
+ * talloc_stackframe() here.
+ */
+ tmp_ctx = talloc_new(talloc_tos());
+
+ fname = shadow_copy2_normalise_path(tmp_ctx, fname, gmt_start);
if (fname == NULL) {
TALLOC_FREE(tmp_ctx);
return NULL;
if (fname == NULL) {
TALLOC_FREE(tmp_ctx);
return NULL;