9f4269c74e
In the course of removing calls to realloc(), change the menu parsing and use logic to use ptr_vector's directly. This also fixes some detects menu issues in parsing and avoids e.g. writing to a bad pointer (or should; of course it needs testing...). Finally, free menu state on return from the menu_system function. There was a comment here to do that, but it didn't appear to be done. Signed-off-by: Dan Cross <patchdev@fat-dragon.org>