From: Florian Forster Date: Wed, 3 Jan 2024 17:39:52 +0000 (+0100) Subject: write_open_telemetry plugin: Fix minor memory leak. X-Git-Tag: 6.0.0-rc0~17^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4180%2Fhead;p=thirdparty%2Fcollectd.git 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) ``` --- 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);