mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-02-18 10:11:15 +01:00
Segmentation fault fix
This commit is contained in:
parent
c8de221c11
commit
3d740e4a66
1 changed files with 3 additions and 2 deletions
|
|
@ -1034,7 +1034,7 @@ char **strsplit_by_str(const char str[], char *delim)
|
|||
substr = strdup(strparse);
|
||||
tokens[tokens_used] = dmcalloc(strlen(substr)+1, sizeof(char));
|
||||
strcpy(tokens[tokens_used], strparse);
|
||||
tokens[tokens_used+1] = NULL;
|
||||
tokens_used++;
|
||||
FREE(strparse);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1054,6 +1054,7 @@ char **strsplit_by_str(const char str[], char *delim)
|
|||
strparse = strdup(substr+strlen(delim));
|
||||
} while (substr != NULL);
|
||||
FREE(strparse);
|
||||
tokens[tokens_used] = NULL;
|
||||
return tokens;
|
||||
}
|
||||
|
||||
|
|
@ -1854,7 +1855,7 @@ int check_instance_wildcard_parameter_by_regex(char *parameter, char* regex)
|
|||
}
|
||||
tmp = dmstrdup(res);
|
||||
FREE(res);
|
||||
asprintf(&res, "%s%c", tmp, '$');
|
||||
dmasprintf(&res, "%s%c", tmp, '$');
|
||||
regcomp(®ex1, res, 0);
|
||||
int ret = regexec(®ex1, parameter, 0, NULL, 0);
|
||||
regfree(®ex1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue