mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
analyzer/protocol/dns: fix memory leak
If `dns_TSIG_addl` is not set, then the BroString allocated by ExtractOctets() leaks. Therefore, don't ask ExtractOctets() to copy the data to a BroString if we're not going to use it. Yet another memory leak (out of way too many) which would have been prevented by using smart pointers.
This commit is contained in:
parent
2a7f2e0217
commit
dd377fffba
1 changed files with 1 additions and 1 deletions
|
@ -769,7 +769,7 @@ int DNS_Interpreter::ParseRR_TSIG(DNS_MsgInfo* msg,
|
|||
unsigned int sign_time_msec = ExtractShort(data, len);
|
||||
unsigned int fudge = ExtractShort(data, len);
|
||||
BroString* request_MAC;
|
||||
ExtractOctets(data, len, &request_MAC);
|
||||
ExtractOctets(data, len, dns_TSIG_addl ? &request_MAC : nullptr);
|
||||
unsigned int orig_id = ExtractShort(data, len);
|
||||
unsigned int rr_error = ExtractShort(data, len);
|
||||
ExtractOctets(data, len, 0); // Other Data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue