From e93000d724f43c6718c3665c4254dd7d39b66e0c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 3 Jan 2024 18:39:52 +0100 Subject: [PATCH] write_open_telemetry plugin: Fix minor memory leak. Error: ``` ==171106== 8 bytes in 1 blocks are definitely lost in loss record 58 of 228 ==171106== at 0x48407B4: malloc (vg_replace_malloc.c:381) ==171106== by 0x492E7F9: strdup (strdup.c:42) ==171106== by 0x1131F9: cf_util_get_string (configfile.c:1127) ==171106== by 0x4EA3FD0: ot_config_node (write_open_telemetry.cc:206) ==171106== by 0x4EA3FD0: ??? (write_open_telemetry.cc:262) ==171106== by 0x111794: dispatch_block_plugin (configfile.c:464) ==171106== by 0x1119B9: dispatch_block (configfile.c:508) ==171106== by 0x11313D: cf_read (configfile.c:1100) ==171106== by 0x11034E: configure_collectd (collectd.c:356) ==171106== by 0x1104B6: init_config (collectd.c:406) ==171106== by 0x121F3F: main (cmd.c:167) ``` --- src/write_open_telemetry.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/write_open_telemetry.cc b/src/write_open_telemetry.cc index 34096f68d..8491724c0 100644 --- a/src/write_open_telemetry.cc +++ b/src/write_open_telemetry.cc @@ -156,6 +156,7 @@ static void ot_callback_decref(void *data) { cb->stub.reset(); + sfree(cb->name); sfree(cb->host); sfree(cb->port); -- 2.47.2