test: Avoid use-after-free
p
was the pointer given to Xmureallocarray
. p2
is the return
value.
reallocarray.c: In function ‘test_Xmureallocarray_oversize’:
reallocarray.c:162:5: warning: pointer ‘p’ used after ‘realloc’ [-Wuse-after-free]
162 | free(p);
| ^~~~~~~
Fixes: 35eb34a9 ("test: Add simple test cases for functions in src/reallocarray.c")
Edited by Matt Turner