SIGSEGV runtime error in Shortest Path in Binary Trees

Could someone please tell me why this is giving me a runtime error (SIGSEGV).

The problem is CodeChef: Practical coding for everyone

Here is my code for this problem: CodeChef: Practical coding for everyone

Please don’t ask problems from the On-going contest.