summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-08-02 20:59:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:22 -0500
commita4cdedcc085e0b9a94e6757a9b427af503ad6593 (patch)
treec6449c72e196f73ade52fae3234ada41f6aa7616 /source3/smbd
parent6ab9ff8e9fd263c51637ea84c7c9fa392e4cf30f (diff)
downloadsamba-a4cdedcc085e0b9a94e6757a9b427af503ad6593.tar.gz
samba-a4cdedcc085e0b9a94e6757a9b427af503ad6593.tar.bz2
samba-a4cdedcc085e0b9a94e6757a9b427af503ad6593.zip
r8950: Fix one more mem leak found by Gunther.
Jeremy. (This used to be commit 547c6ee0a965b425719cdb834dd5d68a3a3e7117)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/msdfs.c8
1 files changed, 4 insertions, 4 deletions
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;
}