mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 02:28:09 +00:00
fixed alloc errors, code format
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user