modules_dup (CK_FUNCTION_LIST **modules)
{
	int count = 0;

	while (modules[count] != NULL)
		count++;

	return memdup (modules, sizeof (CK_FUNCTION_LIST *) * (count + 1));
}
modules_dup (CK_FUNCTION_LIST **modules)
{
	int count = 0;

	while (modules[count] != NULL)
		count++;

	return memdup (modules, sizeof (CK_FUNCTION_LIST *) * (count + 1));
}