Fix Coverity Scan #1619416

This commit is contained in:
Roger A. Light
2025-08-22 15:08:20 +01:00
parent 317fa15e9e
commit ae56aa9c5c
3 changed files with 15 additions and 1 deletions
+5
View File
@@ -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);