summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/service.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 48593446e2..e8775ffd7b 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -60,7 +60,8 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath)
return false;
}
- destname = SMB_STRDUP(connectpath);
+ /* Allocate for strlen + '\0' + possible leading '/' */
+ destname = SMB_MALLOC(strlen(connectpath) + 2);
if (!destname) {
return false;
}