I've tried it like this:
taking $\log$ to the base $10$ on both the sides
$$(x^2-34x+240)\cdot\log(x^2-17x+71)=\log1=0$$ From which it follows that
$$ x^2-34x+240=0\text{ or }x^2-17x+71=1$$ And hence $$x=24,10\text{ or }x=10,7$$
So, the answer should be $7+10+24=41$
but it is wrong.
You had a good starting idea — but you made an oversight, since your calculuation unnecessarily forces the base to be positive.
A simpler way to execute your idea is to first solve this problem:
and this won't have the problem that logarithms introduced.