uri_length = strlen(format_string) + strlen(node->user) +
strlen(node->passwd) + strlen(node->host) + 5 +
strlen(node->db) + 1;
- if ((uri = calloc(sizeof(char), uri_length)) == NULL) {
+ if ((uri = calloc(1, uri_length)) == NULL) {
ERROR("write_mongodb plugin: Not enough memory to assemble "
"authentication string.");
mongoc_client_destroy(node->client);
} else {
format_string = "mongodb://%s:%d";
uri_length = strlen(format_string) + strlen(node->host) + 5 + 1;
- if ((uri = calloc(sizeof(char), uri_length)) == NULL) {
+ if ((uri = calloc(1, uri_length)) == NULL) {
ERROR("write_mongodb plugin: Not enough memory to assemble "
"authentication string.");
mongoc_client_destroy(node->client);
node = calloc(1, sizeof(*node));
if (node == NULL)
- return (ENOMEM);
+ return ENOMEM;
mongoc_init();
node->host = NULL;
node->store_rates = 1;
if (status != 0) {
sfree(node);
- return (status);
+ return status;
}
for (int i = 0; i < ci->children_num; i++) {
if (status != 0)
wm_config_free(node);
- return (status);
+ return status;
} /* }}} int wm_config_node */
static int wm_config(oconfig_item_t *ci) /* {{{ */
child->key);
}
- return (0);
+ return 0;
} /* }}} int wm_config */
void module_register(void) {