summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_cache.c
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2004-03-18 17:11:52 +0000
committerRichard Sharpe <sharpe@samba.org>2004-03-18 17:11:52 +0000
commita650789626f7a546367bf950385bfb3ddb2911ff (patch)
tree8258b530c9f7d88ba102e4515512f77ee8329449 /source3/libsmb/libsmb_cache.c
parentef8eae0688a8c9da20c187b9d5cd6a1e4f425142 (diff)
downloadsamba-a650789626f7a546367bf950385bfb3ddb2911ff.tar.gz
samba-a650789626f7a546367bf950385bfb3ddb2911ff.tar.bz2
samba-a650789626f7a546367bf950385bfb3ddb2911ff.zip
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)
Diffstat (limited to 'source3/libsmb/libsmb_cache.c')
-rw-r--r--source3/libsmb/libsmb_cache.c9
1 files changed, 7 insertions, 2 deletions
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;