Fix bug 528 - wrong service name in tee fitler crashes MaxScale

This commit is contained in:
Mark Riddoch 2014-09-09 08:50:15 +01:00
parent a4ae7ea139
commit 950c30e065
2 changed files with 17 additions and 9 deletions

View File

@ -311,7 +311,8 @@ int i;
* @param filter The filter to add into the chain
* @param session The client session
* @param downstream The filter downstream of this filter
* @return The downstream component for the next filter
* @return The downstream component for the next filter or NULL
* if the filter could not be created
*/
DOWNSTREAM *
filterApply(FILTER_DEF *filter, SESSION *session, DOWNSTREAM *downstream)
@ -331,8 +332,13 @@ DOWNSTREAM *me;
}
}
if (filter->filter == NULL)
filter->filter = (filter->obj->createInstance)(filter->options,
filter->parameters);
{
if ((filter->filter = (filter->obj->createInstance)(filter->options,
filter->parameters)) == NULL)
{
return NULL;
}
}
if ((me = (DOWNSTREAM *)calloc(1, sizeof(DOWNSTREAM))) == NULL)
{
return NULL;

View File

@ -320,12 +320,14 @@ SESSION *bsession;
if (my_session->active)
{
bsession = my_session->branch_session;
router = bsession->service->router;
router_instance = bsession->service->router_instance;
rsession = bsession->router_session;
/** Close router session and all its connections */
router->closeSession(router_instance, rsession);
if ((bsession = my_session->branch_session) != NULL)
{
router = bsession->service->router;
router_instance = bsession->service->router_instance;
rsession = bsession->router_session;
/** Close router session and all its connections */
router->closeSession(router_instance, rsession);
}
dcb_free(my_session->branch_dcb);
/* No need to free the session, this is done as
* a side effect of closing the client DCB of the