From 3da2580f0984139be34b75f142e6a80cfafed199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 9 Mar 2020 07:31:49 +0200 Subject: [PATCH] Fix `list modules` memory leak The wrong JSON function was used: the one without the _new suffix will copy the memory. --- server/core/load_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/load_utils.cc b/server/core/load_utils.cc index fc2274482..3c25398d0 100644 --- a/server/core/load_utils.cc +++ b/server/core/load_utils.cc @@ -531,7 +531,7 @@ static json_t* module_json_data(const LOADED_MODULE* mod, const char* host) if (mod->info->parameters[i].default_value) { - json_object_set(p, "default_value", json_string(mod->info->parameters[i].default_value)); + json_object_set_new(p, "default_value", json_string(mod->info->parameters[i].default_value)); } if (mod->info->parameters[i].type == MXS_MODULE_PARAM_ENUM