diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-16 00:37:34 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-07-10 23:41:14 +0200 |
commit | c8d0593d6495e87603806ada76a399500cdc2831 (patch) | |
tree | d0d9dc88a43ab30a3712a7946d21baea837bebfb /src/plugins/influxdb-writer.c | |
parent | 4f40dc104633e44d3b021fafb1057b7669616926 (diff) |
Fix memory leak and avoid compile warning
Change-Id: Ib0bcba9daad456f63c0ea704e1fa87f44b6acc98
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/plugins/influxdb-writer.c')
-rw-r--r-- | src/plugins/influxdb-writer.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/influxdb-writer.c b/src/plugins/influxdb-writer.c index fdb1a2a..c21f4fd 100644 --- a/src/plugins/influxdb-writer.c +++ b/src/plugins/influxdb-writer.c @@ -132,15 +132,13 @@ CURL *make_curl_write_post(const char *url, json_object *metricsJ) } } - post_data[i] = NULL; - /* Check that we just do not broke the for loop before trying preparing CURL request object */ curl = i == lpd ? curl_wrap_prepare_post_unescaped(url, NULL, "\n", (const char * const*)post_data) : NULL; free(serie); - /*for(i = 0; i < lpd; i++) - free(post_data[i]);*/ + for(i = 0; i < lpd; i++) + free(post_data[i]); free(post_data); return curl; |