在valgrind下运行我的程序后生成以下消息:
4 bytes in 1 blocks are definitely lost in loss record 1 of 11
==21938== at 0x4C2DD10: calloc (vg_replace_malloc.c:623)
==21938== by 0x401636: main (syntax.c:187)
这是检测到泄漏的代码行:
char *word = calloc(4, sizeof(char)); //syntax.c:187
我不明白上述代码的错误。为什么valgrind会产生错误?