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.
changed to %9[^\n] but still seg fault happens....