Fix cppcheck errors

See #286, newest comment. Two memory leaks and a syntax error if ARRAY_LISTS is ever defined.
A simpler fix is to move this delete just before l.1394