aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/darr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/darr.c b/lib/darr.c
index 9700701..d9a8645 100644
--- a/lib/darr.c
+++ b/lib/darr.c
@@ -34,6 +34,7 @@ void darr_ensure_capacity(darr_t *darr, size_t requested)
darr->available =
MAX(darr->used + requested, darr->available * DARR_REALLOC_MULT);
darr->data = realloc(darr->data, darr->available);
+ memset(darr->data + darr->used, 0, darr->available - darr->used);
}
}