summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/table.c b/table.c
index d80d7fd..3e8c7f1 100644
--- a/table.c
+++ b/table.c
@@ -165,7 +165,7 @@ void * remove_table_index(struct table *tbl, struct string name) {
tbl->len--;
void *tmp = realloc(tbl->array, sizeof(*(tbl->array)) * tbl->len);
- if (tmp)
+ if (tmp || (tbl->len == 0))
tbl->array = tmp;
// else: realloc failed on shrinking... so now we have a table that's allocated a bit too big, not much of an issue