summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/mysqlimport.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 880d3ff07cf..9d83e65535d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -524,16 +524,18 @@ static void safe_exit(int error, MYSQL *mysql)
if (mysql)
mysql_close(mysql);
- mysql_library_end();
-#ifdef HAVE_SMEM
- my_free(shared_memory_base_name);
-#endif
- free_defaults(argv_to_free);
- my_free(opt_password);
if (error)
sf_leaking_memory= 1; /* dirty exit, some threads are still running */
else
+ {
+ mysql_library_end();
+#ifdef HAVE_SMEM
+ my_free(shared_memory_base_name);
+#endif
+ free_defaults(argv_to_free);
+ my_free(opt_password);
my_end(my_end_arg); /* clean exit */
+ }
exit(error);
}