CLEANALLRUV coverity fixes
There was code that allowed for a static buffer overflow(CLEANRIDSIZ) in a few places,
but there are previous checks that make this impossible to over run.
A small potential memory leak was also fixed.
Reviewed by: Noriko(Thanks!)
(cherry picked from commit 37e0121445b69405a7d11f9990eb91dc3d3a0d7c)