diff --git a/src/zmalloc.c b/src/zmalloc.c index 087078996f..95096efa31 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -364,11 +364,11 @@ size_t zmalloc_usable_size(void *ptr) { /* Frees the memory buffer pointed by ptr and updates statistics. When using * jemalloc it uses the fast track by specifying the buffer size. * - * ptr must point to the start of the buffer. On systems where we have the - * additional header with size, the caller must do the necessary adjustments to - * ptr. ptr must not be NULL. The caller is responsible to provide the real - * allocaction size. */ + * ptr must point to the start of the buffer. It must have been returned by a + * previous call to the system allocator. ptr must not be NULL. The caller is + * responsible to provide the real allocaction size. */ static inline void zfree_internal(void *ptr, size_t size) { + assert(ptr != NULL); update_zmalloc_stat_free(size); #ifdef USE_JEMALLOC