--- libelwix/src/json.c 2025/08/25 12:44:59 1.12.2.2 +++ libelwix/src/json.c 2025/08/25 13:00:37 1.13 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: json.c,v 1.12.2.2 2025/08/25 12:44:59 misho Exp $ +* $Id: json.c,v 1.13 2025/08/25 13:00:37 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -809,6 +809,23 @@ json_token2array(const char *jstr, jtok_t * __restrict } return arr; +} + +/* + * json_freearray() - Free & destroy allocated array from json_token2array function + * + * @parr = Array + * return -1 error or 0 ok + */ +int +json_freearray(array_t **parr) +{ + if (!parr) + return -1; + + array_Free(*parr); + array_Destroy(parr); + return 0; }