Valgrind安装
bash
wget http://sourceware.org/pub/valgrind/valgrind-3.22.0.tar.bz2
tar -jxf valgrind-3.22.0.tar.bz2
cd valgrind-3.22.0
./configure
make -j 48
sudo make install
valgrind --version
Clion集成了Valgrind Memcheck,可以帮助检测内存错误: