c – Pointer pointing to another pointer, how to use free correctly?


When I have a pointer pointing to another pointer like:

int *ponteiro1 = malloc(sizeof(int));
int *ponteiro2;

*ponteiro1 = 5;

ponteiro2 = ponteiro1;
free(ponteiro2);

And I'm using the free command (pointer2), so should I deallocate pointer1? If yes, should I do a treatment for pointer2?