LINUX.ORG.RU

История изменений

Исправление stD, (текущая версия) :

Дескриптора?

Вот утечка:

 HEAP SUMMARY:
==18318==     in use at exit: 552 bytes in 1 blocks
==18318==   total heap usage: 2,063 allocs, 2,062 frees, 246,008 bytes allocated
==18318== 
==18318== 552 bytes in 1 blocks are still reachable in loss record 1 of 1
==18318==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18318==    by 0x5771CDC: __fopen_internal (iofopen.c:69)
==18318==    by 0x402698: main (stmbot.c:397)
==18318== 
==18318== LEAK SUMMARY:
==18318==    definitely lost: 0 bytes in 0 blocks
==18318==    indirectly lost: 0 bytes in 0 blocks
==18318==      possibly lost: 0 bytes in 0 blocks
==18318==    still reachable: 552 bytes in 1 blocks
==18318==         suppressed: 0 bytes in 0 blocks

Точнее, возможная утечка.

Строка stmbot.c:397 это вот это:

rat_rub = fopen("/tmp/file.txt", "r");

и дублирующее чтение.

Имелось в виду повторная отправка строки (то, чего не должно происходить).

Исходная версия stD, :

Дескриптора?

Вот утечка:

 HEAP SUMMARY:
==18318==     in use at exit: 552 bytes in 1 blocks
==18318==   total heap usage: 2,063 allocs, 2,062 frees, 246,008 bytes allocated
==18318== 
==18318== 552 bytes in 1 blocks are still reachable in loss record 1 of 1
==18318==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18318==    by 0x5771CDC: __fopen_internal (iofopen.c:69)
==18318==    by 0x402698: main (stmbot.c:397)
==18318== 
==18318== LEAK SUMMARY:
==18318==    definitely lost: 0 bytes in 0 blocks
==18318==    indirectly lost: 0 bytes in 0 blocks
==18318==      possibly lost: 0 bytes in 0 blocks
==18318==    still reachable: 552 bytes in 1 blocks
==18318==         suppressed: 0 bytes in 0 blocks

Точнее, возможная утечка.

Строка stmbot.c:397 это вот это:

rat_rub = fopen("/tmp/stm32bot.db", "r");

и дублирующее чтение.

Имелось в виду повторная отправка строки (то, чего не должно происходить).