我有一个程序,它从文件中读取并将项目存储在队列中,然后将它们打印出来。我从 valgrind 得到这个:
HEAP SUMMARY:
in use at exit: 302 bytes in 14 blocks
total heap usage: 30 allocs, 16 frees, 1,230 bytes allocated
302 bytes in 14 blocks are definitely lost in loss record 1 of 1
at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
by 0x372167FB41: strdup (strdup.c:43)
by 0x400A6A: addtoqueue(main.c:30)
by 0x400B5A: addfiletoqueue(main.c:45)
by 0x400C27: main (main.c:62)
LEAK SUMMARY:
definitely lost: 302 bytes in 14 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 0 bytes in 0 blocks
suppressed: 0 bytes in 0 blocks
main.c 第 62 行
addfiletoqueue (queue, argv[argi]);
main.c 的第 45 行
addtoqueue (queue, file, filename);
main.c 第 30 行
readline = strdup (buffer);
assert (readline != NULL);
queue_add (queue, readline);
我需要免费阅读线吗?