summaryrefslogtreecommitdiff
path: root/source/smbd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/connection.c')
-rw-r--r--source/smbd/connection.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/smbd/connection.c b/source/smbd/connection.c
index c2718d4d703..5bb76eb3bd8 100644
--- a/source/smbd/connection.c
+++ b/source/smbd/connection.c
@@ -38,10 +38,17 @@ TDB_CONTEXT *conn_tdb_ctx(void)
static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *pkbuf, struct connections_key *pkey)
{
ZERO_STRUCTP(pkey);
- ZERO_STRUCTP(pkbuf);
pkey->pid = sys_getpid();
pkey->cnum = conn?conn->cnum:-1;
fstrcpy(pkey->name, name);
+#ifdef DEVELOPER
+ /* valgrind fixer... */
+ {
+ size_t sl = strlen(pkey->name);
+ if (sizeof(fstring)-sl)
+ memset(&pkey->name[sl], '\0', sizeof(fstring)-sl);
+ }
+#endif
pkbuf->dptr = (char *)pkey;
pkbuf->dsize = sizeof(*pkey);