eggdrop
eggdrop copied to clipboard
Fix tdns leak and init attr only once
Found by: https://github.com/michaelortmann Patch by: https://github.com/michaelortmann Fixes:
One-line summary: Fix tdns leak and init attr only once
Additional description (if needed):
Also cleaned up code structure, moved tdns init code from main.c to dns.c:init_tdns()
Test cases demonstrating functionality (if applicable): before:
$ valgrind --leak-check=full ./eggdrop -t BotA.conf 2>&1|grep dns.c
.tcl dnslookup google.com foo
.die
==11075== by 0x24E202: core_dns_ipbyhost (dns.c:620)
==11075== by 0x24E973: tcl_dnsipbyhost (dns.c:369)
==11075== by 0x24E640: tcl_dnslookup (dns.c:739)
https://github.com/eggheads/eggdrop/blob/d317ac228eb6682fdd6386007e09d627efd618ca/src/dns.c#L620 after:
$ valgrind --leak-check=full ./eggdrop -t BotA.conf 2>&1|grep dns.c
.tcl dnslookup google.com foo
.die