- /* Copy the values. This way, we can assure `targets' that they get
- * dynamically allocated values, which they can free and replace if
- * they like. */
- if ((pre_cache_chain != NULL) || (post_cache_chain != NULL))
- {
- saved_values = vl->values;
- saved_values_len = vl->values_len;
-
- vl->values = (value_t *) calloc (vl->values_len,
- sizeof (*vl->values));
- if (vl->values == NULL)
- {
- ERROR ("plugin_dispatch_values: calloc failed.");
- vl->values = saved_values;
- return (-1);
- }
- memcpy (vl->values, saved_values,
- vl->values_len * sizeof (*vl->values));
- }
- else /* if ((pre == NULL) && (post == NULL)) */
- {
- saved_values = NULL;
- saved_values_len = 0;
- }
-