You should be asking your client before fixing the bug.
The client may decide that they want your precious time spent on other things and that they can either afford to live with the bug, or get someone else to fix it.
Fix it if they say to do so.
Regardless, seeing as you fixed it, you should definitely tell the client. They may have depended on the bug being there, already know about it and assigned someone to fix it already...
As for this being your code - disclosing the bug to client about it is the professional thing to do. If their business depends on your software, they would not appreciate not knowing about the bug. They may have it deployed in several locations and without your report would not know that they need to update all locations as soon as possible.
They will appreciate your honesty and professionalism more than worry about the bug (unless it cost them an arm and a leg already...).