From aa6e93820cb1dd252c7cf4380f9b326e58e89df6 Mon Sep 17 00:00:00 2001 From: Phil Turnbull Date: Wed, 14 Jun 2017 11:02:59 -0400 Subject: [PATCH] Silence false-positive warning in ts_record_free This is safe but I think it is technically undefined behaviour to use a pointer after it has been freed: test/helpers/record_alloc.cc:75:3: warning: Use of memory after it is freed record_deallocation(pointer); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- test/helpers/record_alloc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers/record_alloc.cc b/test/helpers/record_alloc.cc index fca5ec02..f7cd5950 100644 --- a/test/helpers/record_alloc.cc +++ b/test/helpers/record_alloc.cc @@ -71,8 +71,8 @@ void *ts_record_calloc(size_t count, size_t size) { } void ts_record_free(void *pointer) { - free(pointer); record_deallocation(pointer); + free(pointer); } bool ts_record_allocations_toggle(bool value) {