I would suggest the following approach, of course it must be tested but I think it should work.
If you do a In-Order-Traversal of the binary tree you would find the nodes in the left-right order. Now, we can check if a node is a leaf, and if it's a leaf we have to do two things:
1. link the previous leaf to current leaf
2. update the current leaf as the previous
void inOrderTraversal(Node root, Node previous){
if(root!=null){
inOrderTraversal(root.left, previous);
if(root.left==null && root.right==null){
if(previous!=null)
previous.right=root;
previous=root;
}
inOrderTraversal(root.right, previous);
}
}
In this way you have a better space complexity: O(1).