mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-23 08:33:48 +08:00
Fix Coverity Scan #1619416
This commit is contained in:
@@ -620,6 +620,11 @@ static void line_callback(char *line)
|
||||
char *saveptr = NULL;
|
||||
char *command = strtok_r(line, " ", &saveptr);
|
||||
|
||||
if(!command){
|
||||
free(line);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!strcasecmp(command, "addClientRole")){
|
||||
ctrl_shell_command_generic_arg2("addClientRole", "username", "rolename", &saveptr);
|
||||
}else if(!strcasecmp(command, "addGroupClient")){
|
||||
|
||||
@@ -97,8 +97,13 @@ static void line_callback(char *line)
|
||||
}
|
||||
|
||||
char *saveptr = NULL;
|
||||
char *command = strtok_r(line, " ", &saveptr);
|
||||
bool found = false;
|
||||
char *command = strtok_r(line, " ", &saveptr);
|
||||
|
||||
if(!command){
|
||||
free(line);
|
||||
return;
|
||||
}
|
||||
|
||||
for(size_t i=0; i<sizeof(mod_data)/sizeof(struct module_data); i++){
|
||||
if(!strcasecmp(command, mod_data[i].name)){
|
||||
|
||||
@@ -104,6 +104,10 @@ static void line_callback(char *line)
|
||||
}
|
||||
|
||||
command = strtok_r(line, " ", &saveptr);
|
||||
if(!command){
|
||||
free(line);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!strcasecmp(command, "auth")){
|
||||
free(data.username);
|
||||
|
||||
Reference in New Issue
Block a user