]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: README.Coding for file_name_hash()
authorVolker Lendecke <vl@samba.org>
Thu, 23 Oct 2025 17:26:27 +0000 (19:26 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 10 Nov 2025 13:29:30 +0000 (13:29 +0000)
Initialize pointers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/files.c

index 3c03f7b8dd396d1fac5bb186380517c1eed538a4..38270779bc0a6576d8fc9415b88644de46f0ea2b 100644 (file)
@@ -2582,9 +2582,9 @@ static NTSTATUS file_name_hash(connection_struct *conn,
                               uint32_t *p_name_hash)
 {
        char tmpbuf[PATH_MAX];
-       char *fullpath, *to_free;
+       char *fullpath = NULL, *to_free = NULL;
        ssize_t len;
-       TDB_DATA key;
+       TDB_DATA key = {.dptr = NULL};
 
        /* Set the hash of the full pathname. */
 
@@ -2592,7 +2592,6 @@ static NTSTATUS file_name_hash(connection_struct *conn,
                strlcpy(tmpbuf, name, sizeof(tmpbuf));
                fullpath = tmpbuf;
                len = strlen(fullpath);
-               to_free = NULL;
        } else {
                len = full_path_tos(conn->connectpath,
                                    name,