Fixes:
source3/libsmb/clidfs.c:350:3: warning: Dereference of undefined pointer value <--[clang]
DLIST_ADD_END(referring_cli, cli);
^
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
int name_type,
struct cli_state **pcli)
{
- struct cli_state *cli;
+ struct cli_state *cli = NULL;
NTSTATUS status;
status = do_connect(ctx, server, share,
return status;
}
+ /*
+ * This can't happen, this test is to satisfy static
+ * checkers (clang)
+ */
+ if (cli == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
/* Enter into the list. */
if (referring_cli) {
DLIST_ADD_END(referring_cli, cli);