--- libelwix/src/json.c 2017/11/29 08:32:46 1.1.2.10 +++ libelwix/src/json.c 2017/11/30 13:45:38 1.1.2.11 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: json.c,v 1.1.2.10 2017/11/29 08:32:46 misho Exp $ +* $Id: json.c,v 1.1.2.11 2017/11/30 13:45:38 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -563,6 +563,7 @@ json_token2array(const char *jstr, jtok_t * __restrict } } else { elwix_SetErr(J_ERR_PARAM, "%s", jerrstr[J_ERR_PARAM]); + ait_freeVars(&arr); return NULL; } @@ -921,7 +922,7 @@ json_add_pair(char * __restrict jstr, int jlen, int ws jstr[eos] = 0; return -1; } - if ((len = json_add_string(jstr, jlen, 0, key)) == -1) { + if ((len = json_add_string(jstr, jlen, 0, val)) == -1) { jstr[eos] = 0; return -1; }