1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s4/libcli/ldab: clang: Fix 'Access results in a deref of a null pointer'

Fixes:

source4/libcli/ldap/ldap_client.c:1023:6: warning: Access to field 'type' results in a dereference of a null pointer <--[clang]
        if ((*msg)->type != type) {
            ^~~~~~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
Noel Power 2019-07-10 16:13:38 +01:00 committed by Gary Lockyer
parent 80f5461ae6
commit 8aed7e9aae

View File

@ -1020,7 +1020,7 @@ _PUBLIC_ NTSTATUS ldap_result_one(struct ldap_request *req, struct ldap_message
if (!NT_STATUS_IS_OK(status)) {
return status;
}
if ((*msg)->type != type) {
if ((*msg) != NULL && (*msg)->type != type) {
*msg = NULL;
return NT_STATUS_UNEXPECTED_NETWORK_ERROR;
}