From: Florian Forster Date: Thu, 25 Jun 2015 20:18:27 +0000 (+0200) Subject: write_redis plugin: Call freeReplyObject() for each redisReply. X-Git-Tag: collectd-5.5.1~91 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ba5d00054e24261b3b8cbbef56dc6e6ae54f61bc;p=collectd.git write_redis plugin: Call freeReplyObject() for each redisReply. --- diff --git a/src/write_redis.c b/src/write_redis.c index 02663c66..2a6f9124 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -134,12 +134,19 @@ static int wr_write (const data_set_t *ds, /* {{{ */ } rr = redisCommand (node->conn, "ZADD %s %s %s", key, time, value); - if (rr==NULL) + if (rr == NULL) WARNING("ZADD command error. key:%s message:%s", key, node->conn->errstr); + else + freeReplyObject (rr); + /* TODO(octo): This is more overhead than necessary. Use the cache and + * metadata to determine if it is a new metric and call SADD only once for + * each metric. */ rr = redisCommand (node->conn, "SADD collectd/values %s", ident); if (rr==NULL) WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr); + else + freeReplyObject (rr); pthread_mutex_unlock (&node->lock);