X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fopenldap.c;h=615aee338b28b70cba4cab0260c09d3ba7c1a847;hp=dc93334458c5fc46e95fc1b7406cfd1bbc27ec21;hb=354f9991530248e45207d236eb74c1cc3d5238ef;hpb=01ec4734ca5434d93f428809a796da0d01ff5088 diff --git a/src/openldap.c b/src/openldap.c index dc933344..615aee33 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -31,6 +31,11 @@ #include "plugin.h" #include "configfile.h" +#if defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Wdeprecated-declarations" +#endif + #include #include @@ -556,13 +561,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) @@ -735,3 +739,7 @@ void module_register (void) /* {{{ */ plugin_register_init ("openldap", cldap_init); plugin_register_shutdown ("openldap", cldap_shutdown); } /* }}} void module_register */ + +#if defined(__APPLE__) +#pragma clang diagnostic pop +#endif