libsmb: Use a direct struct initializer
authorVolker Lendecke <vl@samba.org>
Sun, 10 Mar 2019 14:40:45 +0000 (15:40 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 18 Mar 2019 19:21:23 +0000 (19:21 +0000)
There's a few ways to initialize a DATA_BLOB to NULL. There's the
variable data_blob_null, there's ZERO_STRUCTP, and the explicit
initializer. And there's the data_blob() macro which calls into
data_blob_talloc_named. You have to look at that routine to see that
this is nothing more than a ZERO_STRUCT() and not calling into
talloc. Choose the more direct way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smb2_create_blob.c

index 5bbcec4e4a8be84f82cc280e056e125986562a3a..457ed290fbab24fec4a39785b7e8eae85e546edd 100644 (file)
@@ -159,7 +159,7 @@ NTSTATUS smb2_create_blob_push(TALLOC_CTX *mem_ctx, DATA_BLOB *buffer,
        uint32_t i;
        NTSTATUS status;
 
-       *buffer = data_blob(NULL, 0);
+       *buffer = (DATA_BLOB) { 0 };
        for (i=0; i < blobs.num_blobs; i++) {
                bool last = false;
                const struct smb2_create_blob *c;