brake question

Ok, i have a small brake fluid leak in the back caliper, i found this when i took the back tire checking for a leak, i took the caliper off without disconnecting the ebrake, the ebrake was not engaged either, i put it back went for a drive and that side started heating up really bad, to the point where it started to smoke.

should i have unhooked the ebrake first, and what should i do to fix it, if that would be the problem, thanks