Fix cppcheck errors

See #286, newest comment. Two memory leaks and a syntax error if ARRAY_LISTS is ever defined.
Okay, I was confused and looked at wrong block, sorry.  Your changes are fine.