mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08: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
|
// Versions of realloc/malloc which abort() on out of memory
|
||||||
|
|
||||||
inline void* safe_realloc(void* ptr, size_t size) {
|
inline void* safe_realloc(void* ptr, size_t size) {
|
||||||
ptr = realloc(ptr, size);
|
void* new_ptr = realloc(ptr, size);
|
||||||
if ( size && ! ptr )
|
if ( size && ! new_ptr )
|
||||||
out_of_memory("realloc");
|
out_of_memory("realloc");
|
||||||
|
|
||||||
return ptr;
|
return new_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void* safe_malloc(size_t size) {
|
inline void* safe_malloc(size_t size) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue