Line 11 is rather amusing.
Read the FAQ about why you shouldn't cast malloc.
Don't call malloc to allocate two nodes when you are only inserting one. I don't know what you ever thought was going to...