diff options
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 898b583a58b..89460d7099d 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -175,8 +175,10 @@ void STDCALL mysql_server_end() #ifdef EMBEDDED_LIBRARY end_embedded_server(); #endif - /* If library called my_init(), free memory allocated by it */ finish_client_errs(); + vio_end(); + + /* If library called my_init(), free memory allocated by it */ if (!org_my_init_done) { my_end(MY_DONT_FREE_DBUG); @@ -184,8 +186,11 @@ void STDCALL mysql_server_end() DBUG_POP(); } else + { + free_charsets(); mysql_thread_end(); - vio_end(); + } + mysql_client_init= org_my_init_done= 0; #ifdef EMBEDDED_SERVER if (stderror_file) @@ -2522,7 +2527,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) DBUG_RETURN(1); } - net_clear(net); /* Sets net->write_pos */ + net_clear(net, 1); /* Sets net->write_pos */ /* Reserve place for null-marker bytes */ null_count= (stmt->param_count+7) /8; if (my_realloc_str(net, null_count + 1)) |