diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-11-18 02:33:47 +0100 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-11-18 02:33:47 +0100 |
commit | 23f37ff5054d77abf7baf7b6d01d660b435d81cd (patch) | |
tree | 0412df3e83e34fdf27d5fa9498ddfb95a43bfa7f /include | |
parent | 54fdec0e51d17ac47582ca23c32ce10da5591aa2 (diff) | |
download | afl++-23f37ff5054d77abf7baf7b6d01d660b435d81cd.tar.gz |
fixed alloc errors, code format
Diffstat (limited to 'include')
-rw-r--r-- | include/alloc-inl.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/alloc-inl.h b/include/alloc-inl.h index a6194f86..68255fb6 100644 --- a/include/alloc-inl.h +++ b/include/alloc-inl.h @@ -694,10 +694,11 @@ static inline void *afl_realloc(void **buf, size_t size_needed) { } /* alloc */ - struct afl_alloc_buf *newer_buf = (struct afl_alloc_buf *)realloc(new_buf, next_size); + struct afl_alloc_buf *newer_buf = + (struct afl_alloc_buf *)realloc(new_buf, next_size); if (unlikely(!newer_buf)) { - free(new_buf); // avoid a leak + free(new_buf); // avoid a leak *buf = NULL; return NULL; @@ -707,7 +708,6 @@ static inline void *afl_realloc(void **buf, size_t size_needed) { } - new_buf->complete_size = next_size; *buf = (void *)(new_buf->buf); return *buf; @@ -736,10 +736,11 @@ static inline void *afl_realloc_exact(void **buf, size_t size_needed) { if (unlikely(current_size == size_needed)) { return *buf; } /* alloc */ - struct afl_alloc_buf *newer_buf = (struct afl_alloc_buf *)realloc(new_buf, size_needed); + struct afl_alloc_buf *newer_buf = + (struct afl_alloc_buf *)realloc(new_buf, size_needed); if (unlikely(!newer_buf)) { - free(new_buf); // avoid a leak + free(new_buf); // avoid a leak *buf = NULL; return NULL; |