The problem is probably the scanf `%11[^\n]`. Since you only allocate enough space for 10 chars, that should be %9, one less to account for the null-terminator.
You mean, I can only do as char* copy = malloc(sizeof(char)*10); ?