There's nothing wrong with C. On the other hand, there's a lot of things wrong with writing a daemon that doesn't have proper privilege separation.
P.S. Higher level languages are vulnerable to a variety of attacks that C isn't. For example, eval-based attacks or SQL injection attacks. The solution to these problems is the same: validate user inputs carefully, and structure your application into different components that communicate by message passing, rather than a single giant blob.