You need Visa if you are going to do a self transfer or plan to stay some time in KL. You may have to apply Transit Visa or take suitable Visitor Visa. Malaysia is Strict and it depends on your planning.
Visa is needed only if you want to go out of airport to city . In this case you need to apply for a visa if you wish to visit city and come back to airport for Bali flight or else you can wait in airport and cant go out .