diff options
author | Derrell Lipman <derrell@samba.org> | 2006-03-01 01:41:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:52 -0500 |
commit | c52968b35b65920fafd569254a0a0aaff9508d11 (patch) | |
tree | 88aac26b6fc57e16ef2819f98762724bc1ce9561 /source3 | |
parent | b532e866446803aaafa0f68340d0a868870d9dfc (diff) | |
download | samba-c52968b35b65920fafd569254a0a0aaff9508d11.tar.gz samba-c52968b35b65920fafd569254a0a0aaff9508d11.tar.bz2 samba-c52968b35b65920fafd569254a0a0aaff9508d11.zip |
r13761: r13221@cabra: derrell | 2006-02-28 20:40:56 -0500
When only allowing one connection per server, the cache needs to track which
share is currently connected, or we never know whether a tdis()/tcon() for the
new share is required.
(This used to be commit ad0a725ef5f68db442b3b217c5a852086eff9297)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/libsmb_cache.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c index e6033faf50..14577146fd 100644 --- a/source3/libsmb/libsmb_cache.c +++ b/source3/libsmb/libsmb_cache.c @@ -156,6 +156,17 @@ static SMBCSRV * smbc_get_cached_server(SMBCCTX * context, const char * server, continue; } + + SAFE_FREE(srv->share_name); + srv->share_name = SMB_STRDUP(share); + if (!srv->share_name) { + /* Out of memory. */ + cli_shutdown(&srv->server->cli); + context->callbacks.remove_cached_srv_fn(context, srv->server); + continue; + } + + return srv->server; } } |