Oops.. thanks!
I have a if else to initialize c_sock, I assume scoped_ptr will scope it in the if/else?
I added delete before every return.