#include #include struct s { int i; }; static void fv(struct s *s) { /* Do something with s */ free(s); s = NULL; } static void fr(struct s **s) { /* Do something with s */ free(*s); *s = NULL; } int main(void) { struct s *s; s = malloc(sizeof(*s)); printf("s: %p\n", s); fv(s); printf("s: %p\n", s); printf("\n"); s = malloc(sizeof(*s)); printf("s: %p\n", s); fr(&s); printf("s: %p\n", s); return 0; }