From: Pavel Filipenský Date: Fri, 7 Jan 2022 12:55:38 +0000 (+0100) Subject: s3:modules: VFS CAP symlinkat always fails X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=41ebb7f68c5b21492f503afc4cb341a97654a43d;p=ddiss%2Fsamba-autobuild%2F.git s3:modules: VFS CAP symlinkat always fails BUG: https://bugzilla.samba.org/show_bug.cgi?id=14941 Found by covscan. Since capnew is initialized by NULL, checking it too early makes the rest of the function a dead code. Pair-programmed-with: Andreas Schneider Signed-off-by: Pavel Filipenský Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 4a47b26c7b9..43c8edb8932 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -448,7 +448,7 @@ static int cap_symlinkat(vfs_handle_struct *handle, int saved_errno = 0; int ret; - if (!capold || !capnew) { + if (capold == NULL) { errno = ENOMEM; return -1; }