bool create_msdfs_link(const struct junction_map *jucn)
{
+ TALLOC_CTX *frame = talloc_stackframe();
char *path = NULL;
struct smb_filename *cwd_fname = NULL;
char *msdfs_link = NULL;
struct smb_filename *smb_fname = NULL;
if(!junction_to_local_path(jucn, &path, &conn, &cwd_fname)) {
+ TALLOC_FREE(frame);
return False;
}
DEBUG(5,("create_msdfs_link: Creating new msdfs link: %s -> %s\n",
path, msdfs_link));
- smb_fname = synthetic_smb_fname(talloc_tos(),
+ smb_fname = synthetic_smb_fname(frame,
path,
NULL,
NULL,
ret = True;
out:
- TALLOC_FREE(smb_fname);
vfs_ChDir(conn, cwd_fname);
- TALLOC_FREE(cwd_fname);
SMB_VFS_DISCONNECT(conn);
conn_free(conn);
+ TALLOC_FREE(frame);
return ret;
}
bool remove_msdfs_link(const struct junction_map *jucn)
{
+ TALLOC_CTX *frame = talloc_stackframe();
char *path = NULL;
struct smb_filename *cwd_fname = NULL;
connection_struct *conn;
struct smb_filename *smb_fname;
if (!junction_to_local_path(jucn, &path, &conn, &cwd_fname)) {
+ TALLOC_FREE(frame);
return false;
}
- smb_fname = synthetic_smb_fname(talloc_tos(),
+ smb_fname = synthetic_smb_fname(frame,
path,
NULL,
NULL,
0);
if (smb_fname == NULL) {
+ TALLOC_FREE(frame);
errno = ENOMEM;
return false;
}
ret = True;
}
- TALLOC_FREE(smb_fname);
vfs_ChDir(conn, cwd_fname);
- TALLOC_FREE(cwd_fname);
SMB_VFS_DISCONNECT(conn);
conn_free(conn);
+ TALLOC_FREE(frame);
return ret;
}