How did you come to know that there is no legal issue if you have not received any salary from the company?
There may not be any legal issue but an employee employer relationship is built not on the legal frame work alone but there is something called sensible and moral responsibilities. If your appointment was at the factory gate (just walk in, take job, do the work, collect wages and walk out....) then you need not have to worry about the moral of the relationship. On the other hand, if you were invited for an interview, you were given an offer letter on a remuneration acceptable to you, the company waited for one or more months so that you can get relieved from your previous company and then you joined and after that the company took pain to get you inducted; if this is the situation, leaving is just unethical, if not illegal.
Madhu.T.K