diff options
author | Monty <monty@mariadb.org> | 2017-10-31 13:44:25 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-10-31 13:44:25 +0200 |
commit | bd20fb87ec34535fa82bfa79c28851587ae145b0 (patch) | |
tree | be6cfc69e5987fcde22b4c41b455096cb86b182a | |
parent | 157f2b25512c898bf9ac20556d9e7b06b0256e49 (diff) | |
download | mariadb-git-bd20fb87ec34535fa82bfa79c28851587ae145b0.tar.gz |
Write error message ebfore aborting if not all memory is released
Also don't abort if global_status_var.global_memory_used != 0 on not
normal exit as then it's likely that not all memory is released.
-rw-r--r-- | sql/mysqld.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0e1543ecd2f..069092a0e32 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2161,15 +2161,15 @@ static void mysqld_exit(int exit_code) shutdown_performance_schema(); // we do it as late as possible #endif set_malloc_size_cb(NULL); - if (!opt_debugging && !my_disable_leak_check) + if (opt_endinfo && global_status_var.global_memory_used) + fprintf(stderr, "Warning: Memory not freed: %ld\n", + (long) global_status_var.global_memory_used); + if (!opt_debugging && !my_disable_leak_check && exit_code == 0) { DBUG_ASSERT(global_status_var.global_memory_used == 0); } cleanup_tls(); DBUG_LEAVE; - if (opt_endinfo && global_status_var.global_memory_used) - fprintf(stderr, "Warning: Memory not freed: %ld\n", - (long) global_status_var.global_memory_used); sd_notify(0, "STATUS=MariaDB server is down"); exit(exit_code); /* purecov: inspected */ } |