]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Replace talloc_zero() with a struct initialization
authorVolker Lendecke <vl@samba.org>
Tue, 8 Apr 2025 07:49:17 +0000 (09:49 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 15 May 2025 14:03:34 +0000 (14:03 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/fd_handle.c

index b0190681f7a3efed9b4e9019e5b227f6864de0b0..f25aa3e412f690dcd2a8f51c2cee6dd26b535257 100644 (file)
@@ -38,11 +38,11 @@ struct fd_handle *fd_handle_create(TALLOC_CTX *mem_ctx)
 {
        struct fd_handle *fh = NULL;
 
-       fh = talloc_zero(mem_ctx, struct fd_handle);
+       fh = talloc(mem_ctx, struct fd_handle);
        if (fh == NULL) {
                return NULL;
        }
-       fh->fd = -1;
+       *fh = (struct fd_handle) { .fd = -1, };
 
        talloc_set_destructor(fh, fd_handle_destructor);