fixed alloc errors, code format

This commit is contained in:
Dominik Maier
2020-11-18 02:33:47 +01:00
parent 54fdec0e51
commit 23f37ff505
6 changed files with 25 additions and 15 deletions

View File

@ -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;