How do I make LeakSanitizer ignore end of program leaks

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How do I make LeakSanitizer ignore end of program leaks



I want to use LeakSanitizer to detect leaked memory, but the style of the program I am using does not free memory before exit. This is fairly common in my experience.


exit



I want to detect this leak:


int main(int argc, char const *argv)
{
char *p = malloc(5);
*p = 0;
return 0;
}



And ignore this leak:


int main(int argc, char const *argv)
{
char *p = malloc(5);
return 0;
}









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived