Fixed a possible memory leak when session command history limits are used.

This commit is contained in:
Markus Makela
2015-03-05 20:46:55 +02:00
parent 1299cf6ac9
commit c937568624
2 changed files with 5 additions and 1 deletions

View File

@ -290,6 +290,7 @@ struct router_client_session {
int rses_capabilities; /*< input type, for example */
bool rses_autocommit_enabled;
bool rses_transaction_active;
DCB* client_dcb;
#if defined(PREP_STMT_CACHING)
HASHTABLE* rses_prep_stmt[2];
#endif

View File

@ -790,6 +790,7 @@ static void* newSession(
#endif
client_rses->router = router;
client_rses->client_dcb = session->client;
/**
* If service config has been changed, reload config from service to
* router instance first.
@ -4355,8 +4356,10 @@ static bool route_session_write(
LOGFILE_TRACE,
"Router session exceeded session command history limit. "
"Closing router session. <")));
router_cli_ses->rses_closed = true;
gwbuf_free(querybuf);
rses_end_locked_router_action(router_cli_ses);
router_cli_ses->client_dcb->func.hangup(router_cli_ses->client_dcb);
goto return_succp;
}