bool is_case_sensitive)
{
int ret, count, i;
- struct max_n *max_n = NULL;
if (strcmp(string, "..") == 0) {
string = ".";
if (pattern[i] == '*' || pattern[i] == '<') count++;
}
- max_n = talloc_zero_array(NULL, struct max_n, count);
- if (max_n == NULL) {
- return -1;
- }
+ {
+ struct max_n max_n[count];
- ret = ms_fnmatch_core(pattern, string, max_n, strrchr(string, '.'),
- is_case_sensitive);
+ memset(max_n, 0, sizeof(struct max_n) * count);
- talloc_free(max_n);
+ ret = ms_fnmatch_core(pattern, string, max_n, strrchr(string, '.'),
+ is_case_sensitive);
+ }
return ret;
}