I think `free(s);` is enough. No need to check and assign to `NULL` after free.