Commit
509081e7e ("smbd: expand logging in contend_dirleases()") added a
log-trace which calls get_current_dir_name() on-the-fly, which caused a
Coverity issue (memory-leak). Replace this call with the proper call to
SMB_VFS_GETWD (+ release memory).
Fixes Coverity issue
1648344
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 13 09:55:09 UTC 2025 on atb-devel-224
ret = SMB_VFS_STAT(conn, parent_fname);
if (ret != 0) {
+ struct smb_filename *cwd = SMB_VFS_GETWD(conn, talloc_tos());
+
DBG_ERR("Trigger [conn: %s] [smb_fname: %s] cwd [%s], "
"failed to stat parent [%s]: %s\n",
conn->connectpath,
smb_fname_str_dbg(smb_fname),
- get_current_dir_name(),
+ (cwd != NULL) ? cwd->base_name : "",
smb_fname_str_dbg(parent_fname),
strerror(errno));
TALLOC_FREE(parent_fname);
+ TALLOC_FREE(cwd);
return;
}