mirror of
https://github.com/json-c/json-c.git
synced 2026-04-08 23:09:07 +08:00
Fix possible memory leak
This commit is contained in:
@@ -253,6 +253,9 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
|
|||||||
the string length is less than INT32_MAX (2GB) */
|
the string length is less than INT32_MAX (2GB) */
|
||||||
if ((len < -1) || (len == -1 && strlen(str) > INT32_MAX)) {
|
if ((len < -1) || (len == -1 && strlen(str) > INT32_MAX)) {
|
||||||
tok->err = json_tokener_error_size;
|
tok->err = json_tokener_error_size;
|
||||||
|
#ifdef HAVE_SETLOCALE
|
||||||
|
free(oldlocale);
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user