]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Remove an unneeded NULL check
authorVolker Lendecke <vl@samba.org>
Mon, 20 May 2024 08:38:47 +0000 (10:38 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 04:23:29 +0000 (04:23 +0000)
We have dereferenced p_last_name_raw before in the call to
data_blob_free, our only caller does give us a pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libsmb/clilist.c

index 807e511dc8257a95eeb0bfbff7e980519a77e794..2dbde30020153009d58482f34eb118c98c92b995 100644 (file)
@@ -298,11 +298,10 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                           Namelen doesn't include the terminating unicode null, so
                           copy it here. */
 
-                       if (p_last_name_raw) {
-                               *p_last_name_raw = data_blob(NULL, namelen+2);
-                               memcpy(p_last_name_raw->data, p, namelen);
-                               SSVAL(p_last_name_raw->data, namelen, 0);
-                       }
+                       *p_last_name_raw = data_blob(NULL, namelen + 2);
+                       memcpy(p_last_name_raw->data, p, namelen);
+                       SSVAL(p_last_name_raw->data, namelen, 0);
+
                        return calc_next_entry_offset(base, pdata_end);
                }
        }