fix memory leak in json_mod.c