diff --git a/src/fast_task_queue.c b/src/fast_task_queue.c index aed0e78..9baf905 100644 --- a/src/fast_task_queue.c +++ b/src/fast_task_queue.c @@ -463,6 +463,7 @@ static int _realloc_buffer(struct fast_task_info *pTask, const int new_size, const bool copy_data) { char *new_buff; + new_buff = (char *)fc_malloc(new_size); if (new_buff == NULL) { diff --git a/src/shared_func.h b/src/shared_func.h index bdf42ff..7756d52 100644 --- a/src/shared_func.h +++ b/src/shared_func.h @@ -1277,6 +1277,15 @@ static inline int fc_check_realloc_iovec_array( return 0; } +static inline void fc_free_iovec_array(iovec_array_t *array) +{ + if (array->iovs != NULL) { + free(array->iovs); + array->iovs = NULL; + array->alloc = 0; + } +} + static inline pid_t fc_gettid() { #ifdef OS_LINUX