Memory-leak in nft

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is still some memory-leak in nft which is due to no matching free for
xstrdup in scanner.l:580.
In main.c, argv is passed as a const, and in main.c:270 filename points to this
const location (by optarg).
So it would be safe to remove xstrdup from scanner.l:580.

$ sudo valgrind --leak-check=full nft -f ~/backup.nft

==4075== 22 bytes in 1 blocks are definitely lost in loss record 1 of 3
==4075==    at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4075==    by 0x57A3839: strdup (strdup.c:42)
==4075==    by 0x41C0BD: xstrdup (utils.c:64)
==4075==    by 0x41EFA1: scanner_push_file (scanner.l:581)
==4075==    by 0x426C88: scanner_read_file (scanner.l:601)
==4075==    by 0x406225: main (main.c:347)
==4075== 
==4075== LEAK SUMMARY:
==4075==    definitely lost: 22 bytes in 1 blocks
==4075==    indirectly lost: 0 bytes in 0 blocks
==4075==      possibly lost: 0 bytes in 0 blocks
==4075==    still reachable: 832 bytes in 2 blocks
==4075==         suppressed: 0 bytes in 0 blocks

-- 

With regards,
Piyush Pangtey <gokuvsvegita@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux