I was playing with this code:

```
#include <stdlib.h>
#include <stdio.h>

void function(int *p){
    free(p);
}

int main(){
    int *i = calloc(3, sizeof(int));
    function(i);
    i[0] = 'a';
    printf("%c\n", i[0]);
    return 0;
}

```

I expected to get an error, but instead it printed 'a', if 'a' is deallocated why does it print it? What happens in function(int \*p) has any effect if the main()?(if you can, explain what happen to that 'p' pointer)

Suppose that I have those two in the same function:

```
int *a = malloc(...);
int *b = a;

```

Both of them point to the same piece of memory, but when I have to free it, should I call free on both of them, or just one of them?(again explain why if possible)