strdup
strdup("hello") is malloc(6) + strcpy in one call. Use it when you’re storing a caller’s string and don’t trust them not to free it or overwrite it behind your back.
char *copy = strdup(user_input); // owns its own buffer
free(copy); // forget this, leak
If the input disappears, your copy still stands. Short POSIX function, but not strictly C99. Some strict compilers need -D_POSIX_C_SOURCE=200809L to see it.