开发者

memory (leaks) after executing

开发者 https://www.devze.com 2022-12-22 15:56 出处:网络
I\'m wondering 开发者_StackOverflowwhy randomly after executing the ./a.out I get the following. Any ideas what I\'m doing wrong? Thanks

I'm wondering 开发者_StackOverflowwhy randomly after executing the ./a.out I get the following. Any ideas what I'm doing wrong? Thanks

memory (leaks) after executing

http://img710.imageshack.us/img710/8708/trasht.png


As the error suggests you probably have a double free() or heap corruption

Edit: Either you're freeing the same buffer more than once or you're writing bytes in a memory region you shouldn't be writing to. The latter might be caused by writing in the buffer after freeing it or writing outside the buffer bounds.

Perhaps Memcheck can help pinpoint the problem.

Compile your program with debug information cc -g and run valgrind ./a.out

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号