summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_dfs_nt.c2
-rw-r--r--source3/smbd/msdfs.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c
index 938b01540f..b005192010 100644
--- a/source3/rpc_server/srv_dfs_nt.c
+++ b/source3/rpc_server/srv_dfs_nt.c
@@ -319,7 +319,7 @@ WERROR _dfs_enum(pipes_struct *p, DFS_Q_DFS_ENUM *q_u, DFS_R_DFS_ENUM *r_u)
struct junction_map jn[MAX_MSDFS_JUNCTIONS];
int num_jn = 0;
- num_jn = enum_msdfs_links(jn, ARRAY_SIZE(jn));
+ num_jn = enum_msdfs_links(p->mem_ctx, jn, ARRAY_SIZE(jn));
vfs_ChDir(p->conn,p->conn->connectpath);
DEBUG(5,("make_reply_dfs_enum: %d junctions found in Dfs, doing level %d\n", num_jn, level));
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index e66c13ab93..0f63966a7d 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -948,7 +948,7 @@ BOOL remove_msdfs_link(struct junction_map* jucn)
return ret;
}
-static int form_junctions(int snum, struct junction_map* jucn, int jn_remain)
+static int form_junctions(TALLOC_CTX *ctx, int snum, struct junction_map* jucn, int jn_remain)
{
int cnt = 0;
DIR *dirp;
@@ -981,7 +981,7 @@ static int form_junctions(int snum, struct junction_map* jucn, int jn_remain)
jucn[cnt].volume_name[0] = '\0';
jucn[cnt].referral_count = 1;
- ref = jucn[cnt].referral_list = SMB_MALLOC_P(struct referral);
+ ref = jucn[cnt].referral_list = TALLOC_P(ctx, struct referral);
if (jucn[cnt].referral_list == NULL) {
DEBUG(0, ("Malloc failed!\n"));
goto out;
@@ -1023,7 +1023,7 @@ out:
return cnt;
}
-int enum_msdfs_links(struct junction_map* jucn, int jn_max)
+int enum_msdfs_links(TALLOC_CTX *ctx, struct junction_map* jucn, int jn_max)
{
int i=0;
int jn_count = 0;
@@ -1033,7 +1033,7 @@ int enum_msdfs_links(struct junction_map* jucn, int jn_max)
for(i=0;i < lp_numservices() && (jn_max - jn_count) > 0;i++) {
if(lp_msdfs_root(i))
- jn_count += form_junctions(i,jucn,jn_max - jn_count);
+ jn_count += form_junctions(ctx, i,jucn,jn_max - jn_count);
}
return jn_count;
}