jsoninfo: fix a resource leak