From a650789626f7a546367bf950385bfb3ddb2911ff Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Thu, 18 Mar 2004 17:11:52 +0000 Subject: Commit Derrell Lipman's changes and fixes to libsmbclient. The build but I have not tested them beyond building. I did fix the two instances of safe_strxxx that were introduced. (This used to be commit bf89adbcb4c77792004e4ea9da248b71b72b7dbb) --- source3/libsmb/libsmb_cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/libsmb_cache.c') diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c index 67dc686b48..cb40b4aaa6 100644 --- a/source3/libsmb/libsmb_cache.c +++ b/source3/libsmb/libsmb_cache.c @@ -159,10 +159,15 @@ static int smbc_remove_cached_server(SMBCCTX * context, SMBCSRV * server) */ static int smbc_purge_cached(SMBCCTX * context) { - struct smbc_server_cache * srv = NULL; + struct smbc_server_cache * srv; + struct smbc_server_cache * next; int could_not_purge_all = 0; - for (srv=((struct smbc_server_cache *) context->server_cache);srv;srv=srv->next) { + for (srv = ((struct smbc_server_cache *) context->server_cache), + next = (srv ? srv->next :NULL); + srv; + srv = next, next = (srv ? srv->next : NULL)) { + if (smbc_remove_unused_server(context, srv->server)) { /* could not be removed */ could_not_purge_all = 1; -- cgit