From 44293df2aeaeccb1e2cca18bb7d61534a5e07b1a Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Tue, 6 Dec 2005 17:09:44 +0000 Subject: r12098: r10797@cabra: derrell | 2005-12-06 12:09:00 -0500 fixed another memory leak and reverted an (incorrect) fix from yesterday (This used to be commit 8a86d7bddc291da094d060fbe185f071ffdbddd8) --- source3/libsmb/libsmbclient.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 9fda48a540..e6906eb79a 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -483,6 +483,8 @@ int smbc_remove_unused_server(SMBCCTX * context, SMBCSRV * srv) DEBUG(3, ("smbc_remove_usused_server: %p removed.\n", srv)); context->callbacks.remove_cached_srv_fn(context, srv); + + SAFE_FREE(srv); return 0; } @@ -822,9 +824,9 @@ SMBCSRV *smbc_attr_server(SMBCCTX *context, SMBCSRV *ipc_srv=NULL; /* - * See if we've already created this special connection. Reference our - * "special" share name '*IPC$', which is an impossible real share name - * due to the leading asterisk. + * See if we've already created this special connection. Reference + * our "special" share name '*IPC$', which is an impossible real share + * name due to the leading asterisk. */ ipc_srv = find_server(context, server, "*IPC$", workgroup, username, password); @@ -2386,9 +2388,11 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) /* Now, list the stuff ... */ - if (!cli_NetServerEnum(&srv->cli, workgroup, SV_TYPE_DOMAIN_ENUM, list_unique_wg_fn, + if (!cli_NetServerEnum(&srv->cli, + workgroup, + SV_TYPE_DOMAIN_ENUM, + list_unique_wg_fn, (void *)dir)) { - if (dir) { SAFE_FREE(dir->fname); SAFE_FREE(dir); -- cgit