]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Fix a memory leak in the `write_stackdriver` plugin 4101/head
authorAden Grue <agrue@google.com>
Thu, 23 Mar 2023 18:48:10 +0000 (11:48 -0700)
committerAden Grue <agrue@google.com>
Thu, 23 Mar 2023 18:48:10 +0000 (11:48 -0700)
The `payload` was never freed. This was affecting potentially every call to both the "write" and "flush" callbacks.

src/write_stackdriver.c

index 8fe85a3ea1bb558a884692c70ad29758082d2b93..a60d0b9b07ae2ef42d74e8b4c9a96e13dece5a17 100644 (file)
@@ -343,6 +343,7 @@ static int wg_flush_nolock(cdtime_t timeout, wg_callback_t *cb) /* {{{ */
   char *payload = sd_output_reset(cb->formatter);
   int status = wg_call_timeseries_write(cb, payload);
   wg_reset_buffer(cb);
+  sfree(payload);
   return status;
 } /* }}} wg_flush_nolock */