summaryrefslogtreecommitdiff
path: root/lib/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/list.c')
-rw-r--r--lib/list.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/list.c b/lib/list.c
index 2123818..fb0bdb2 100644
--- a/lib/list.c
+++ b/lib/list.c
@@ -79,8 +79,10 @@ int _bmItemListGrow(struct _bmItemList *list, unsigned int step)
if (!(tmp = malloc(nsize)))
return 0;
- if (list->list)
+ if (list->list) {
memcpy(tmp, list->list, sizeof(bmItem*) * list->allocated);
+ free(list->list);
+ }
}
list->list = tmp;