Fix memory leak when backend authentication fails
If the backend authentication failed for a user, the buffer containing the error packet would leak.
This commit is contained in:
@ -401,7 +401,6 @@ mxs_auth_state_t handle_server_response(DCB *dcb, GWBUF *buffer)
|
||||
}
|
||||
}
|
||||
|
||||
gwbuf_free(buffer);
|
||||
return rval;
|
||||
}
|
||||
|
||||
@ -498,7 +497,6 @@ gw_read_backend_event(DCB *dcb)
|
||||
}
|
||||
|
||||
proto->protocol_auth_state = state;
|
||||
gwbuf_free(readbuf);
|
||||
}
|
||||
else if (proto->protocol_auth_state == MXS_AUTH_STATE_RESPONSE_SENT)
|
||||
{
|
||||
@ -527,6 +525,8 @@ gw_read_backend_event(DCB *dcb)
|
||||
/** Authentication failed */
|
||||
gw_reply_on_error(dcb, proto->protocol_auth_state);
|
||||
}
|
||||
|
||||
gwbuf_free(readbuf);
|
||||
}
|
||||
else if (proto->protocol_auth_state == MXS_AUTH_STATE_CONNECTED &&
|
||||
dcb->ssl_state == SSL_ESTABLISHED)
|
||||
|
Reference in New Issue
Block a user