smb2_query_directory: make 'return true' explicit in smb2_query_directory_next_entry()
authorStefan Metzmacher <metze@samba.org>
Tue, 31 Jul 2018 07:45:00 +0000 (09:45 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 31 Jul 2018 12:20:49 +0000 (14:20 +0200)
'return req' should do the same as 'return true' for a bool function,
it's implicitly expanded as 'return (req!=NULL)?true:false.

There's no point in that as 'req' is always a valid pointer.

This was most likely just a copy and paste bug.

So we make this explicit now and avoid that Coverity reports this:

CID 1438158:  Null pointer dereferences  (REVERSE_INULL)
Null-checking "req" suggests that it may be null, but it has already
been dereferenced on all paths leading to the check.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul 31 14:20:49 CEST 2018 on sn-devel-144

source3/smbd/smb2_query_directory.c

index 9052779081783fa534c86ca7a01708b74c6a3acc..f3b61737da79ee1236bacc7529da4433cbafe885 100644 (file)
@@ -718,7 +718,7 @@ last_entry_done:
                tevent_req_set_callback(subreq,
                                        smb2_query_directory_waited,
                                        req);
-               return req;
+               return true;
        }
 
        tevent_req_done(req);