Merge pull request #2287 from BrandonArp/fix_am_1_11
[collectd.git] / src / write_mongodb.c
index 66dc8e0..3cdc3d1 100644 (file)
@@ -171,7 +171,7 @@ static int wm_initialize(wm_node_t *node) /* {{{ */
     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);
@@ -196,7 +196,7 @@ static int wm_initialize(wm_node_t *node) /* {{{ */
   } 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);
@@ -317,7 +317,7 @@ static int wm_config_node(oconfig_item_t *ci) /* {{{ */
 
   node = calloc(1, sizeof(*node));
   if (node == NULL)
-    return (ENOMEM);
+    return ENOMEM;
   mongoc_init();
   node->host = NULL;
   node->store_rates = 1;
@@ -327,7 +327,7 @@ static int wm_config_node(oconfig_item_t *ci) /* {{{ */
 
   if (status != 0) {
     sfree(node);
-    return (status);
+    return status;
   }
 
   for (int i = 0; i < ci->children_num; i++) {
@@ -388,7 +388,7 @@ static int wm_config_node(oconfig_item_t *ci) /* {{{ */
   if (status != 0)
     wm_config_free(node);
 
-  return (status);
+  return status;
 } /* }}} int wm_config_node */
 
 static int wm_config(oconfig_item_t *ci) /* {{{ */
@@ -404,7 +404,7 @@ static int wm_config(oconfig_item_t *ci) /* {{{ */
               child->key);
   }
 
-  return (0);
+  return 0;
 } /* }}} int wm_config */
 
 void module_register(void) {