Advisor professor asking me for the source code of my dissertation in order to be used by another student
You developed the code as part of your curriculum. It's quite possible that therefore, the source code belongs to the university anyway. This does depend on the laws of the country your university is in.

Also, I don't see what you should be concerned about. Someone else building on your work is exactly how science is supposed to proceed. If I were you, I'd take the request as a compliment.