From: Aden Grue Date: Thu, 23 Mar 2023 18:48:10 +0000 (-0700) Subject: Fix a memory leak in the `write_stackdriver` plugin X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4101%2Fhead;p=thirdparty%2Fcollectd.git Fix a memory leak in the `write_stackdriver` plugin The `payload` was never freed. This was affecting potentially every call to both the "write" and "flush" callbacks. --- diff --git a/src/write_stackdriver.c b/src/write_stackdriver.c index 8fe85a3ea..a60d0b9b0 100644 --- a/src/write_stackdriver.c +++ b/src/write_stackdriver.c @@ -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 */