X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fopenldap.c;h=36a29f8dadb229a3955308035e71d3d012ca5c20;hb=ff9e11ade5cfabf32c63fb19fc76cbbc4186bc5b;hp=0a86d521e508158ebd97b8a84bfe67568e927b23;hpb=5c2993e4121feae745551be182221b31bc23ff97;p=collectd.git diff --git a/src/openldap.c b/src/openldap.c index 0a86d521..36a29f8d 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -130,7 +130,7 @@ static int cldap_init_host (cldap_t *st) /* {{{ */ cred.bv_len = 0; } - rc = ldap_sasl_bind_s (st->ld, st->binddn, LDAP_SASL_SIMPLE, &cred, + rc = ldap_sasl_bind_s (st->ld, st->binddn, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); if (rc != LDAP_SUCCESS) { @@ -553,13 +553,12 @@ static int cldap_config_add (oconfig_item_t *ci) /* {{{ */ int i; int status; - st = malloc (sizeof (*st)); + st = calloc (1, sizeof (*st)); if (st == NULL) { - ERROR ("openldap plugin: malloc failed."); + ERROR ("openldap plugin: calloc failed."); return (-1); } - memset (st, 0, sizeof (*st)); status = cf_util_get_string (ci, &st->name); if (status != 0)