From: Anmol Sarma Date: Thu, 1 Oct 2015 08:39:09 +0000 (+0530) Subject: Fix possible memory leak X-Git-Tag: json-c-0.13-20171207~179^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f37b0a10a5eb74c2389a3595ac60c3f0dc7406f0;p=thirdparty%2Fjson-c.git Fix possible memory leak --- diff --git a/json_tokener.c b/json_tokener.c index 8b1e3e6d..98611d63 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -253,6 +253,9 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok, the string length is less than INT32_MAX (2GB) */ if ((len < -1) || (len == -1 && strlen(str) > INT32_MAX)) { tok->err = json_tokener_error_size; +#ifdef HAVE_SETLOCALE + free(oldlocale); +#endif return NULL; }