fix crash at execute empty flush command
This commit is contained in:
committed by
Markus Mäkelä
parent
847dd2c120
commit
2b653887a3
@ -354,6 +354,13 @@ exec_flush(DCB *dcb, MAXINFO_TREE *tree)
|
|||||||
int i;
|
int i;
|
||||||
char errmsg[120];
|
char errmsg[120];
|
||||||
|
|
||||||
|
sprintf(errmsg, "Unsupported flush command '%s'", tree->value);
|
||||||
|
if(!tree)
|
||||||
|
{
|
||||||
|
maxinfo_send_error(dcb, 0, errmsg);
|
||||||
|
MXS_ERROR("%s", errmsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (i = 0; flush_commands[i].name; i++)
|
for (i = 0; flush_commands[i].name; i++)
|
||||||
{
|
{
|
||||||
if (strcasecmp(flush_commands[i].name, tree->value) == 0)
|
if (strcasecmp(flush_commands[i].name, tree->value) == 0)
|
||||||
@ -366,7 +373,6 @@ exec_flush(DCB *dcb, MAXINFO_TREE *tree)
|
|||||||
{
|
{
|
||||||
tree->value[80] = 0;
|
tree->value[80] = 0;
|
||||||
}
|
}
|
||||||
sprintf(errmsg, "Unsupported flush command '%s'", tree->value);
|
|
||||||
maxinfo_send_error(dcb, 0, errmsg);
|
maxinfo_send_error(dcb, 0, errmsg);
|
||||||
MXS_ERROR("%s", errmsg);
|
MXS_ERROR("%s", errmsg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user