summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-07-28 20:35:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:23 -0500
commit9d9c90f31a2e92ed6d6d9f247add7388a67a2a0c (patch)
tree71332dcf17e5fcc733a03b6166b29ef484ee87b0
parentd30bcf9c485eb0447cbae56318c4134e490693c5 (diff)
downloadsamba-9d9c90f31a2e92ed6d6d9f247add7388a67a2a0c.tar.gz
samba-9d9c90f31a2e92ed6d6d9f247add7388a67a2a0c.tar.bz2
samba-9d9c90f31a2e92ed6d6d9f247add7388a67a2a0c.zip
r17291: Fix memory leaks on early exit path.
Jeremy. (This used to be commit deaac5bd463e5b8fd0b9915b553fdac3a4271293)
-rw-r--r--source3/libsmb/clidfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 4280b0628e..0135881021 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -713,12 +713,14 @@ BOOL cli_check_msdfs_proxy( struct cli_state *cli, const char *sharename,
res = cli_dfs_get_referral(cli, fullpath, &refs, &num_refs, &consumed);
if (!cli_tdis(cli)) {
+ SAFE_FREE( refs );
return False;
}
cli->cnum = cnum;
if (!res || !num_refs ) {
+ SAFE_FREE( refs );
return False;
}
@@ -726,8 +728,10 @@ BOOL cli_check_msdfs_proxy( struct cli_state *cli, const char *sharename,
/* check that this is not a self-referral */
- if ( strequal( cli->desthost, newserver ) && strequal( sharename, newshare ) )
+ if ( strequal( cli->desthost, newserver ) && strequal( sharename, newshare ) ) {
+ SAFE_FREE( refs );
return False;
+ }
SAFE_FREE( refs );