[cfe-users] check for double delete

Bernd Schubert bernd.schubert at itwm.fraunhofer.de
Fri Aug 2 05:09:40 PDT 2013


Hi all,

is there some way to instruct the static analyzer to check for double 
deleted objects?


void foo(my_object_t obj)
{
	delete obj;
}

main()
{
	my_object_t *obj = new my_object_t;
	
	if (!obj)
		return -1;

	foo(obj);

	delete obj;
}


I just found something like that in my code and the static analyzer 
hadn't detected it.


Thanks,
Bernd




More information about the cfe-users mailing list