Fix double free error when expanding lists

This commit is contained in:
Wilson Lin 2018-08-08 10:41:56 +12:00
parent e2e12f408b
commit 6ca4363936
1 changed files with 2 additions and 2 deletions

View File

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