diff options
author | Johann CAHIER <johann.cahier@iot.bzh> | 2019-05-16 17:35:59 +0200 |
---|---|---|
committer | Johann CAHIER <johann.cahier@iot.bzh> | 2019-05-24 10:04:47 +0200 |
commit | 5dd410aab93c4ea5c3c04662585c072172ea5547 (patch) | |
tree | 3e8a46b7bf643bc918cda5a25872d5b43d4b632c /src/plugins/influxdb-reader.c | |
parent | 8c0851b6fdf7690ae25a6fbd83e0f2795a8cdf8b (diff) |
Better memory management in chained list
key is now managed internally, using a copy.
add_elt() / add_key() now provide a 'suffix' parameter.
If suffix is given, it is appended to the key.
If NULL, or empty string ("") is given, nothing is appended.
NOTE : value is still owned by json object.
Bug-AGL: SPEC-2416
Change-Id: I624a2dd211801c2d24b2c6739f2c7536a047ea32
Signed-off-by: Johann CAHIER <johann.cahier@iot.bzh>
Diffstat (limited to 'src/plugins/influxdb-reader.c')
-rw-r--r-- | src/plugins/influxdb-reader.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/influxdb-reader.c b/src/plugins/influxdb-reader.c index d7ddac7..c633e9f 100644 --- a/src/plugins/influxdb-reader.c +++ b/src/plugins/influxdb-reader.c @@ -70,10 +70,10 @@ static void fill_key(void *c, json_object *columnJ) struct metrics_list *m_list = (struct metrics_list *)c; if(strncasecmp(&column[length-2], "_t", 2) == 0) { - add_key(&m_list->serie.serie_columns.tags, column); + add_key(&m_list->serie.serie_columns.tags, column, ""); } else if(strncasecmp(&column[length-2], "_f", 2) == 0) { - add_key(&m_list->serie.serie_columns.fields, column); + add_key(&m_list->serie.serie_columns.fields, column, ""); } } |