mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
Fix clang-tidy bugprone-suspicious-realloc-usage warnings in headers
This commit is contained in:
parent
a58110986d
commit
9c3dddfa12
1 changed files with 3 additions and 3 deletions
|
@ -454,11 +454,11 @@ extern void safe_close(int fd);
|
|||
// Versions of realloc/malloc which abort() on out of memory
|
||||
|
||||
inline void* safe_realloc(void* ptr, size_t size) {
|
||||
ptr = realloc(ptr, size);
|
||||
if ( size && ! ptr )
|
||||
void* new_ptr = realloc(ptr, size);
|
||||
if ( size && ! new_ptr )
|
||||
out_of_memory("realloc");
|
||||
|
||||
return ptr;
|
||||
return new_ptr;
|
||||
}
|
||||
|
||||
inline void* safe_malloc(size_t size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue