In the first one, you allocated a char array of length 6, and you assigned it the values 'H', 'e', 'l', 'l', 'o', 0. Essentially, you did a bitwise copy of the string literal, which is why when you try to write to it, the runtime doesn't mind.
In the second one, however, you're creating a pointer to the string literal itself. String literals are stored in sections of memory that are illegal to write to.