summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1ebf2f3)
raw | patch | inline | side by side (parent: 1ebf2f3)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 28 Mar 2016 17:24:17 +0000 (19:24 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 28 Mar 2016 17:24:17 +0000 (19:24 +0200) |
Don't log that malloc failed when we call calloc
src/collectd-nagios.c | patch | blob | history | |
src/mqtt.c | patch | blob | history | |
src/oracle.c | patch | blob | history | |
src/redis.c | patch | blob | history | |
src/utils_db_query.c | patch | blob | history |
diff --git a/src/collectd-nagios.c b/src/collectd-nagios.c
index 49e84f35f8d2d1d54dcf77a54d130b9b91425275..712c24fa5b153272b5be422b0ef2ae7fcdf12eb8 100644 (file)
--- a/src/collectd-nagios.c
+++ b/src/collectd-nagios.c
new_values = (gauge_t *)calloc (match_ds_num_g, sizeof (*new_values));
if (new_values == NULL)
{
- fprintf (stderr, "malloc failed: %s\n", strerror (errno));
+ fprintf (stderr, "calloc failed: %s\n", strerror (errno));
return (RET_UNKNOWN);
}
new_names = (char **)calloc (match_ds_num_g, sizeof (*new_names));
if (new_names == NULL)
{
- fprintf (stderr, "malloc failed: %s\n", strerror (errno));
+ fprintf (stderr, "calloc failed: %s\n", strerror (errno));
free (new_values);
return (RET_UNKNOWN);
}
diff --git a/src/mqtt.c b/src/mqtt.c
index 4977f6841e72454c46ecbb35f5c995254dd48e3f..0b00bab860939ede191e8aa5a278bb7cce8d76f1 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
conf = calloc (1, sizeof (*conf));
if (conf == NULL)
{
- ERROR ("mqtt plugin: malloc failed.");
+ ERROR ("mqtt plugin: calloc failed.");
return (-1);
}
conf->publish = 1;
conf = calloc (1, sizeof (*conf));
if (conf == NULL)
{
- ERROR ("mqtt plugin: malloc failed.");
+ ERROR ("mqtt plugin: calloc failed.");
return (-1);
}
conf->publish = 0;
diff --git a/src/oracle.c b/src/oracle.c
index 84d9ed4952d2c1837f5cb783fc85226f3193a221..fedefd0930e445ac8f33f314c6124c69da3fd935 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
if (db->q_prep_areas == NULL)
{
- WARNING ("oracle plugin: malloc failed");
+ WARNING ("oracle plugin: calloc failed");
status = -1;
break;
}
diff --git a/src/redis.c b/src/redis.c
index 4e3de56c8dfa854f5104f9f53b79bb91ee553dec..919a8312b226d37649f7ad6e598b91788ca9c787 100644 (file)
--- a/src/redis.c
+++ b/src/redis.c
rq = calloc(1, sizeof(*rq));
if (rq == NULL) {
- ERROR("redis plugin: calloca failed adding redis_query.");
+ ERROR("redis plugin: calloc failed adding redis_query.");
return NULL;
}
status = cf_util_get_string_buffer(ci, rq->query, sizeof(rq->query));
diff --git a/src/utils_db_query.c b/src/utils_db_query.c
index d003e7fa389211b81026932819612970f7728875..de435cb4e64afd40f2574b94ec06292d7bbe9aae 100644 (file)
--- a/src/utils_db_query.c
+++ b/src/utils_db_query.c
vl.values = (value_t *) calloc (r->values_num, sizeof (value_t));
if (vl.values == NULL)
{
- ERROR ("db query utils: malloc failed.");
+ ERROR ("db query utils: calloc failed.");
return (-1);
}
vl.values_len = r_area->ds->ds_num;
= (size_t *) calloc (r->instances_num, sizeof (size_t));
if (prep_area->instances_pos == NULL)
{
- ERROR ("db query utils: udb_result_prepare_result: malloc failed.");
+ ERROR ("db query utils: udb_result_prepare_result: calloc failed.");
BAIL_OUT (-ENOMEM);
}
= (char **) calloc (r->instances_num, sizeof (char *));
if (prep_area->instances_buffer == NULL)
{
- ERROR ("db query utils: udb_result_prepare_result: malloc failed.");
+ ERROR ("db query utils: udb_result_prepare_result: calloc failed.");
BAIL_OUT (-ENOMEM);
}
} /* if (r->instances_num > 0) */
= (size_t *) calloc (r->values_num, sizeof (size_t));
if (prep_area->values_pos == NULL)
{
- ERROR ("db query utils: udb_result_prepare_result: malloc failed.");
+ ERROR ("db query utils: udb_result_prepare_result: calloc failed.");
BAIL_OUT (-ENOMEM);
}
= (char **) calloc (r->values_num, sizeof (char *));
if (prep_area->values_buffer == NULL)
{
- ERROR ("db query utils: udb_result_prepare_result: malloc failed.");
+ ERROR ("db query utils: udb_result_prepare_result: calloc failed.");
BAIL_OUT (-ENOMEM);
}
= (size_t *) calloc (r->metadata_num, sizeof (size_t));
if (prep_area->metadata_pos == NULL)
{
- ERROR ("db query utils: udb_result_prepare_result: malloc failed.");
+ ERROR ("db query utils: udb_result_prepare_result: calloc failed.");
BAIL_OUT (-ENOMEM);
}
= (char **) calloc (r->metadata_num, sizeof (char *));
if (prep_area->metadata_buffer == NULL)
{
- ERROR ("db query utils: udb_result_prepare_result: malloc failed.");
+ ERROR ("db query utils: udb_result_prepare_result: calloc failed.");
BAIL_OUT (-ENOMEM);
}