Sometimes these problems are easier to work if you consider the average of the two leg lengths. Call that "x".
.. (x -2)^2 +(x +2)^2 = 80 . . . . . . . by the Pythagorean theorem
.. x^2 -4x +4 +x^2 +4x +4 = 80 . . eliminate parentheses
.. 2x^2 +8 = 80 . . . . . . . . . . . . . . . simplify
.. x^2 = (80 -8)/2 = 36
.. x = √36 = 6
Legs are this value ±2.
The leg lengths are 4 and 8.