How to find memory leaks with Clang
问题 I have installed Clang in my machine (ubuntu) in order to find memory leaks in my C code. I wrote a sample code in order to check the working of it which is as follows: /* File: hello.c for leak detection */ #include <stdio.h> #include <stdlib.h> void *x; int main() { x = malloc(2); x = 0; // Memory leak return 0; } I found some options in internet to compile like $ scan-build clang --analyze hello.c and $ scan-build clang -fsanitize=address hello.c But none of them are showing any signs of