]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Initialize all members of struct inotify_watch_context
authorVolker Lendecke <vl@samba.org>
Mon, 26 May 2025 09:53:31 +0000 (11:53 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 2 Jun 2025 17:08:33 +0000 (17:08 +0000)
We don't have talloc_zero()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/notify_inotify.c

index 8645579e1078b699dbbbbf7da9214c96e33aa6eb..b6ff413991184ad97da36fba43dc5e5bb6931e68 100644 (file)
@@ -421,12 +421,15 @@ int inotify_watch(TALLOC_CTX *mem_ctx,
                return ENOMEM;
        }
 
-       w->in = in;
-       w->callback = callback;
-       w->private_data = private_data;
-       w->mask = mask;
-       w->filter = orig_filter;
-       w->path = talloc_strdup(w, path);
+       *w = (struct inotify_watch_context) {
+               .in = in,
+               .callback = callback,
+               .private_data = private_data,
+               .mask = mask,
+               .filter = orig_filter,
+               .path = talloc_strdup(w, path),
+       };
+
        if (w->path == NULL) {
                *filter = orig_filter;
                TALLOC_FREE(w);