From 5cb738ae03ca87178f80503d3c087ab149ea68a0 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 9 Dec 2016 17:38:47 +0200 Subject: [PATCH] Fix minor memory leaks The main function and monitor creation both leaked a few bytes of memory. --- server/core/gateway.cc | 2 ++ server/core/monitor.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 001bf2e82..bb7358961 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -2084,6 +2084,8 @@ return_main: write_child_exit_code(daemon_pipe[1], rc); } + MXS_FREE(cnf_file_arg); + if (threads) { MXS_FREE(threads); diff --git a/server/core/monitor.c b/server/core/monitor.c index e451b5cd3..8f52b0525 100644 --- a/server/core/monitor.c +++ b/server/core/monitor.c @@ -94,7 +94,7 @@ monitor_alloc(char *name, char *module) } mon->state = MONITOR_STATE_ALLOC; mon->name = name; - mon->module_name = module; + mon->module_name = my_module; mon->handle = NULL; mon->databases = NULL; *mon->password = '\0';