diff --git a/source/libcli/ldap/ldap_controls.c b/source/libcli/ldap/ldap_controls.c index 373b71d3709..ccb1b74a558 100644 --- a/source/libcli/ldap/ldap_controls.c +++ b/source/libcli/ldap/ldap_controls.c @@ -137,7 +137,9 @@ static BOOL decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out) } } - lssc[num] = NULL; + if (lssc != NULL) { + lssc[num] = NULL; + } if (!asn1_end_tag(&data)) { return False;