3 ms·
As another poster pointed out, if I run this via valgrind (after fixing the first error): > valgrind ./a.out ==4871== Invalid write of size 4 ==4871==
by reza_n 9y ago
As another poster pointed out, if I run this via valgrind (after fixing the first error):
> valgrind ./a.out
==4871== Invalid write of size 4
==4871== at 0x40073A: vec_push (test.c:40)
==4871== Invalid write of size 4
==4871== at 0x40073A: vec_push (test.c:40)
==4871== Invalid read of size 4
==4871== at 0x4007CD: main (test.c:55)
==4871== Invalid read of size 8
==4871== at 0x400769: vec_free (test.c:46)
==4871== Invalid free() / delete / delete[] / realloc()
==4871== at 0x4C2BDEC: free (...)
==4871== by 0x400770: vec_free (test.c:46)