Re: [Valgrind-users] Detecting all dangling pointers at exit

2018-12-26 Thread Philippe Waroquiers
On Wed, 2018-12-26 at 10:15 +, Kumara, Asanka wrote: > Hi, > Is there a way to detect ALL dangling pointers (at exit) in valgrind ? >   > e.g. >   > char* globalVar; >   > void main() > { >    char* z1 = new char[10]; >    char* z2 = z1; >    globalVar = z2; >   >    delete[] z1; >   > } >   >

[Valgrind-users] Detecting all dangling pointers at exit

2018-12-26 Thread Kumara, Asanka
Hi, Is there a way to detect ALL dangling pointers (at exit) in valgrind ? e.g. char* globalVar; void main() { char* z1 = new char[10]; char* z2 = z1; globalVar = z2; delete[] z1; } At exit of the program say that "globalVar" holds a pointer to a freed memory. --