Fix double free error when expanding lists
This commit is contained in:
parent
e2e12f408b
commit
6ca4363936
|
@ -4,6 +4,8 @@
|
|||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "./mem.c"
|
||||
|
||||
#define INITIAL_LIST_SIZE 20
|
||||
#define LIST_GROWTH_RATE 1.5
|
||||
|
||||
|
@ -87,8 +89,6 @@
|
|||
new_data[i] = 0; \
|
||||
} \
|
||||
\
|
||||
free(buf->data); \
|
||||
\
|
||||
buf->data = new_data; \
|
||||
buf->size = new_size; \
|
||||
} \
|
||||
|
|
Loading…
Reference in New Issue