--- simple.c.old 2013-03-04 16:00:51.000000000 -0500 +++ simple.c 2013-03-04 16:02:17.000000000 -0500 @@ -70,7 +70,12 @@ goto lbl_ret; } - attr = ldap_first_attribute(ldap, msg, &ber); + if (NULL == (attr = ldap_first_attribute(ldap, msg, &ber)) + { + zabbix_log(LOG_LEVEL_DEBUG, "LDAP - empty first entry result. [%s] [%s]", host, ldap_err2string(ldapErr)); + goto lbl_ret; + } + valRes = ldap_get_values(ldap, msg, attr); *value_int = 1;