/ CDTIME_T_TO_DOUBLE (vl->interval);
ce->values_raw[i].absolute = vl->values[i].absolute;
break;
-
+
default:
/* This shouldn't happen. */
ERROR ("uc_insert: Don't know how to handle data source type %i.",
ds->ds[i].type);
+ sfree (key_copy);
+ cache_free (ce);
return (-1);
} /* switch (ds->ds[i].type) */
} /* for (i) */
pthread_mutex_unlock (&cache_lock);
if (keys_len == 0)
+ {
+ /* realloc() may have been called for these. */
+ sfree (keys);
+ sfree (keys_time);
+ sfree (keys_interval);
return (0);
+ }
/* Call the "missing" callback for each value. Do this before removing the
* value from the cache, so that callbacks can still access the data stored,
if (status != 0)
{
ERROR ("uc_check_timeout: parse_identifier_vl (\"%s\") failed.", keys[i]);
- cache_free (ce);
continue;
}
return (ret);
} /* gauge_t *uc_get_rate */
-size_t uc_get_size() {
+size_t uc_get_size (void) {
size_t size_arrays = 0;
pthread_mutex_lock (&cache_lock);
if (status != 0)
{
size_t i;
-
+
for (i = 0; i < number; i++)
{
sfree (names[i]);
}
sfree (names);
+ sfree (times);
return (-1);
}
*ret_names = names;
if (ret_times != NULL)
*ret_times = times;
+ else
+ sfree (times);
*ret_number = number;
return (0);
if (FORMAT_VL (name, sizeof (name), vl) != 0)
{
- ERROR ("uc_get_state: FORMAT_VL failed.");
+ ERROR ("uc_set_state: FORMAT_VL failed.");
return (STATE_ERROR);
}
if (ce->history_length < num_steps)
{
gauge_t *tmp;
- size_t i;
tmp = realloc (ce->history, sizeof (*ce->history)
* num_steps * ce->values_num);
if (FORMAT_VL (name, sizeof (name), vl) != 0)
{
- ERROR ("uc_get_state: FORMAT_VL failed.");
+ ERROR ("uc_get_hits: FORMAT_VL failed.");
return (STATE_ERROR);
}
if (FORMAT_VL (name, sizeof (name), vl) != 0)
{
- ERROR ("uc_get_state: FORMAT_VL failed.");
+ ERROR ("uc_set_hits: FORMAT_VL failed.");
return (STATE_ERROR);
}
if (FORMAT_VL (name, sizeof (name), vl) != 0)
{
- ERROR ("uc_get_state: FORMAT_VL failed.");
+ ERROR ("uc_inc_hits: FORMAT_VL failed.");
return (STATE_ERROR);
}