X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fopenldap.c;h=055f2d16c660568485774f34546eedfba372832a;hb=c13a935c8bdb40daf1f7078fc81bf05b90c7cd90;hp=ffcdb94e8049000961cd19bc65a167387532f9c0;hpb=8eb05d21637cd1eb3b6c4c4d3ed519cc2fd3ebf6;p=collectd.git diff --git a/src/openldap.c b/src/openldap.c index ffcdb94e..055f2d16 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 @@ -548,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) @@ -698,3 +702,7 @@ void module_register (void) /* {{{ */ plugin_register_complex_config ("openldap", cldap_config); plugin_register_init ("openldap", cldap_init); } /* }}} void module_register */ + +#if defined(__APPLE__) +#pragma clang diagnostic pop +#endif