Two researchers want to work on the same extension to my paper. Who to help? I recently presented a paper in a top-tier conference in a computer engineering field. I did that work as a research assistant under a Professor but now I am working in the industry. Two different researchers, let's call them John and Sam, wish to work on an extension to this work. But both need help from me since they feel I will be able to solve their problem quickly based on my experience. John is a PhD student with whom I had worked with and was the second author of the paper. Sam is a PhD student, in another university, who I met at the conference. Since both have a request for help and both are working on the identical extension of the work, who should I help out?

Background:
I originally planned to work on my paper alone along with my advisor. After I was done with about 80% of the work, I met John (who is a Phd student under my advisor) and decided to collaborate with him because he too was working on a similar problem (he at that time was working on the extension itself). John didn't contribute directly with the work (I was sole author of all code and did all analysis with help my the advisor) but he helped me with conference selection and writing of the paper. As John was sponsored by a company, having his name as an author meant that now all the ownership of the work laid with the company, at least that was what I was told by John and the advisor. This meant they had all the rights to the code (though I never signed away my rights explicitly). My advisor is particular about legal issues and hence don't want me to make the code open-source. But since the company was not interested in using the code and I didn't want my work to go to waste, I have made the code open-source, unknown to my advisor or John.

Question: I wish to maximize the use of my work (since it is my first research work). So should I continue to help both John and Sam who are both working on the same topic? My concern is that one of them will have wasted their time if the other is successful in publishing a paper first.

I am more confident about Sam's skills (based on his past papers and John doesn't have much experience in this field) but John has indicated to me from the start that he was more interested in the extension than the work that I did in the paper.

My other option is to reveal to both of them about each other so that they can possibly collaborate. But since I have told Sam that my code is open source, Sam can possibly tell John this information which might irritate my former advisor. I would like to avoid this because I might require future favors such as a letter of recommendation should I choose to pursue PhD.

Edit: I have open-sourced the code via GitHub (changed the repository from private to public). I still haven't added any license (so legally by default it is not open-source as in free to use but anyone can browse through it) so I still retain all rights. Basically, I used the wrong terminology, the code is public (instead of open-source).
I haven't talked with any representative from the company, only my advisor and John have been in contact with them. From what John tells me, the company is no longer interested in the project and I think John's funding is also stopping because of this.

Based on the answers, I am going to ask Sam and John to work together (at least tell both of them about each other) and ask Sam not to reveal about the public code. I am still not convinced about making the code private again because this being a computer engineering field (applied field), just based on paper, it will be hard for anyone to replicate the work (the evidence is that both John and Sam need my help).
Work with both John and Sam on the same paper. You all have something to offer, so pool your efforts and work together.