From 2f7f1a8a40815ee760ca714cf8d116c0805534e4 Mon Sep 17 00:00:00 2001 From: Unbewohnte Date: Sat, 7 Jan 2023 11:36:04 +0300 Subject: [PATCH] Set vector contents to NULL upon freeing --- src/cvec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cvec.c b/src/cvec.c index 6ca032c..fcee257 100644 --- a/src/cvec.c +++ b/src/cvec.c @@ -27,6 +27,7 @@ cvec cvec_new(size_t data_size, size_t cap) { void cvec_free(cvec* vec) { if (vec) { free(vec->contents); + vec->contents = NULL; vec = NULL; } }