]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:modules: Initialize pointer with NULL
authorAndreas Schneider <asn@samba.org>
Fri, 3 Feb 2023 19:29:33 +0000 (20:29 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 6 Feb 2023 22:51:31 +0000 (22:51 +0000)
source3/modules/vfs_glusterfs.c:827:6: error: variable 'glfd' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
  if (pglfd == NULL) {
      ^~~~~~~~~~~~~
source3/modules/vfs_glusterfs.c:853:6: note: uninitialized use occurs here
  if (glfd == NULL) {
      ^~~~
source3/modules/vfs_glusterfs.c:827:2: note: remove the 'if' if its condition is
always true
  if (pglfd == NULL) {
  ^~~~~~~~~~~~~~~~~~~
source3/modules/vfs_glusterfs.c:763:17: note: initialize the variable 'glfd' to
silence this warning
  glfs_fd_t *glfd;
                 ^
                  = NULL

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_glusterfs.c

index 31e606ba5d045124bdb32cb4e46da10622cc86db..5b0654b7a47ead2cf9293ffd6104eda33a9bc2c1 100644 (file)
@@ -760,7 +760,7 @@ static int vfs_gluster_openat(struct vfs_handle_struct *handle,
        struct smb_filename *full_fname = NULL;
        bool have_opath = false;
        bool became_root = false;
-       glfs_fd_t *glfd;
+       glfs_fd_t *glfd = NULL;
        glfs_fd_t *pglfd = NULL;
        glfs_fd_t **p_tmp;