From: Andreas Schneider Date: Fri, 3 Feb 2023 19:29:33 +0000 (+0100) Subject: s3:modules: Initialize pointer with NULL X-Git-Tag: talloc-2.4.1~1690 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5447d7fb75fc00b17cde4dd0ecccd89e8b6f8545;p=thirdparty%2Fsamba.git s3:modules: Initialize pointer with NULL 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 31e606ba5d0..5b0654b7a47 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -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;