write_redis plugin: Check the return value of format_values().
authorFlorian Forster <octo@collectd.org>
Thu, 11 Jun 2015 15:48:55 +0000 (16:48 +0100)
committerFlorian Forster <octo@collectd.org>
Thu, 11 Jun 2015 15:48:55 +0000 (16:48 +0100)
src/write_redis.c

index 2925352..3b8addd 100644 (file)
@@ -69,9 +69,11 @@ static int wr_write (const data_set_t *ds, /* {{{ */
   memset (value, 0, sizeof (value));
   value_size = sizeof (value);
   value_ptr = &value[0];
-  format_values(value_ptr, value_size, ds, vl, 0);
 
+  status = format_values (value_ptr, value_size, ds, vl, /* store rates = */ 0);
   pthread_mutex_lock (&node->lock);
+  if (status != 0)
+    return (status);
 
   if (node->conn == NULL)
   {