alloc path bit table on stack

This commit is contained in:
jjceresa 2019-09-16 17:56:21 +02:00
parent 74c1699867
commit 3795c7dee9

View file

@ -1853,12 +1853,9 @@ fluid_list_check_linked_mod(char *list_name, fluid_mod_t *list_mod,
return 0;
}
/* path allocation */
path = FLUID_MALLOC (sizeof(*path) * count);
if(path == NULL)
{
return FLUID_FAILED;
}
/* path allocation (on stack) */
path = alloca(sizeof(*path) * count);
/* initialize path:
- reset bits FLUID_PATH_VALID, FLUID_PATH_CURRENT
- set bits FLUID_MOD_VALID
@ -1931,9 +1928,6 @@ fluid_list_check_linked_mod(char *list_name, fluid_mod_t *list_mod,
}
}
/* free path */
FLUID_FREE(path);
return result;
}