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);