summaryrefslogtreecommitdiff
path: root/source4/smb_server/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smb_server/connection.c')
-rw-r--r--source4/smb_server/connection.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/smb_server/connection.c b/source4/smb_server/connection.c
index 4cb4f2168a..4badf00ce3 100644
--- a/source4/smb_server/connection.c
+++ b/source4/smb_server/connection.c
@@ -110,12 +110,16 @@ BOOL claim_connection(struct smbsrv_tcon *tcon, const char *name,int max_connect
struct connections_data crec;
TDB_DATA kbuf, dbuf;
- if (!tdb)
- tdb = tdb_open_log(lock_path(tcon->mem_ctx, "connections.tdb"), 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT,
- O_RDWR | O_CREAT, 0644);
+ if (!tdb) {
+ char *lpath = lock_path(tcon, "connections.tdb");
+ tdb = tdb_open_log(lpath, 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT,
+ O_RDWR | O_CREAT, 0644);
+ talloc_free(lpath);
+ }
- if (!tdb)
+ if (!tdb) {
return False;
+ }
/*
* Enforce the max connections parameter.