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!)