rates = uc_get_rate(ds, vl);
if (rates == NULL) {
ERROR("write_mongodb plugin: uc_get_rate() failed.");
- bson_free(ret);
+ bson_destroy(ret);
return NULL;
}
} else {
else {
ERROR("write_mongodb plugin: Unknown ds_type %d for index %d",
ds->ds[i].type, i);
- bson_free(ret);
+ bson_destroy(ret);
return NULL;
}
}
size_t error_location;
if (!bson_validate(ret, BSON_VALIDATE_UTF8, &error_location)) {
ERROR("write_mongodb plugin: Error in generated BSON document "
- "at byte %zu", error_location);
- bson_free(ret);
+ "at byte %zu",
+ error_location);
+ bson_destroy(ret);
return NULL;
}
if (wm_initialize(node) < 0) {
ERROR("write_mongodb plugin: error making connection to server");
pthread_mutex_unlock(&node->lock);
- bson_free(bson_record);
+ bson_destroy(bson_record);
return -1;
}
node->client = NULL;
node->connected = 0;
pthread_mutex_unlock(&node->lock);
- bson_free(bson_record);
+ bson_destroy(bson_record);
return -1;
}
node->client = NULL;
node->connected = 0;
pthread_mutex_unlock(&node->lock);
- bson_free(bson_record);
+ bson_destroy(bson_record);
mongoc_collection_destroy(collection);
return -1;
}
pthread_mutex_unlock(&node->lock);
- bson_free(bson_record);
+ bson_destroy(bson_record);
return 0;
} /* }}} int wm_write */
ssnprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
- status = plugin_register_write(
- cb_name, wm_write, &(user_data_t){
- .data = node, .free_func = wm_config_free,
- });
+ status =
+ plugin_register_write(cb_name, wm_write,
+ &(user_data_t){
+ .data = node, .free_func = wm_config_free,
+ });
INFO("write_mongodb plugin: registered write plugin %s %d", cb_name,
status);
}