diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-06-12 01:14:49 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-06-12 01:14:49 +0200 |
commit | 2b1c8500fcf510083a4cb7572cd99ad51bcff97b (patch) | |
tree | a9862f72d664bceced1494afc577d11a5d0e426e | |
parent | ca7244805b23e4da2951e15e3fd802f18c19854d (diff) |
Assert that we aren’t freeing anything
-rw-r--r-- | src/alloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 35b45c0..8682656 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,3 +1,4 @@ +#include <assert.h> #include <errno.h> #include <stdint.h> #include <stdlib.h> @@ -8,6 +9,7 @@ void * bufalloc(void *ptr, size_t nmemb, size_t size) { + assert(nmemb * size != 0); if (size > SIZE_MAX / nmemb) { errno = EOVERFLOW; err("%s:", __func__); |