void check_kmalloc_wrong_size(int id)
{
	my_id = id;

	if (option_project != PROJ_KERNEL) {
		add_function_assign_hook("malloc", &match_alloc, NULL);
		add_function_assign_hook("calloc", &match_calloc, INT_PTR(1));
		return;
	}

	add_function_assign_hook("kmalloc", &match_alloc, NULL);
	add_function_assign_hook("kcalloc", &match_calloc, INT_PTR(1));
}
Example #2
0
void check_allocation_funcs(int id)
{
	int i;

	if (!option_info || option_project != PROJ_KERNEL)
		return;

	my_id = id;
	add_hook(&match_return, RETURN_HOOK);
	add_hook(&match_end_func, AFTER_FUNC_HOOK);
	for (i = 0; allocation_funcs[i]; i++) {
		add_function_assign_hook(allocation_funcs[i],
					 &match_allocation, NULL);
	}
}
Example #3
0
void check_wine_filehandles(int id)
{
	int i;

	if (option_project != PROJ_WINE)
		return;

	my_id = id;
	for (i = 0; filehandle_funcs[i]; i++) {
		add_function_assign_hook(filehandle_funcs[i],
					 &match_returns_handle, NULL);
	}
	add_hook(&match_condition, CONDITION_HOOK);
	add_modification_hook(my_id, ok_to_use);
}