From 9d9c90f31a2e92ed6d6d9f247add7388a67a2a0c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 Jul 2006 20:35:00 +0000 Subject: r17291: Fix memory leaks on early exit path. Jeremy. (This used to be commit deaac5bd463e5b8fd0b9915b553fdac3a4271293) --- source3/libsmb/clidfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/libsmb') 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 ); -- cgit