mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Fix clang-tidy bugprone-multi-level-implicit-pointer-conversion warnings
This commit is contained in:
parent
9e83759e83
commit
d0bbc61bd4
3 changed files with 13 additions and 3 deletions
|
@ -69,7 +69,12 @@ std::list<std::tuple<IPPrefix, void*>> PrefixTable::FindAll(const IPAddr& addr,
|
|||
out.emplace_back(PrefixToIPPrefix(list[i]->prefix), list[i]->data);
|
||||
|
||||
Deref_Prefix(prefix);
|
||||
free(list);
|
||||
|
||||
// clang-tidy reports a bugprone-multi-level-implicit-pointer-conversion warning here
|
||||
// because the double-pointer is implicitly converted to a void* for the call to
|
||||
// free(). The double-pointer was calloc'd in patricia_search_all as an array of
|
||||
// pointers, so it's safe to free. Explicitly cast it to void* to silence the warning.
|
||||
free(static_cast<void*>(list));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue