I would like to delete a BST, my program works but, I don't know way, AddressSanitizer find an error.
void clear_maxlist(max_list* position){
if(position == NULL)
return;
clear_maxlist(((position)->left));
clear_maxlist(((position)->right));
free(position);
}
I get this error:
==6643==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000004039c1 bp 0x7ffdc2a35f20 sp 0x7ffdc2a35f10 T0)