mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
DNS_Mgr: Fix aliases memory issues
This commit is contained in:
parent
f3fbe45c4c
commit
5859a7e28c
1 changed files with 2 additions and 1 deletions
|
@ -406,6 +406,7 @@ static void query_cb(void* arg, ares_status_t status, size_t timeouts, const are
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
he.h_aliases[idx - 1] = util::copy_string(txt);
|
he.h_aliases[idx - 1] = util::copy_string(txt);
|
||||||
|
he.h_aliases[idx] = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( type == ARES_REC_TYPE_TXT ) {
|
else if ( type == ARES_REC_TYPE_TXT ) {
|
||||||
|
@ -449,7 +450,7 @@ static void query_cb(void* arg, ares_status_t status, size_t timeouts, const are
|
||||||
|
|
||||||
if ( he.h_aliases ) {
|
if ( he.h_aliases ) {
|
||||||
for ( size_t idx = 0; he.h_aliases[idx] != NULL; idx++ ) {
|
for ( size_t idx = 0; he.h_aliases[idx] != NULL; idx++ ) {
|
||||||
delete[] he.h_aliases;
|
delete[] he.h_aliases[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] he.h_aliases;
|
delete[] he.h_aliases;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue