]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Fix possible memory leak
authorAnmol Sarma <me@anmolsarma.in>
Thu, 1 Oct 2015 08:39:09 +0000 (14:09 +0530)
committerAnmol Sarma <me@anmolsarma.in>
Thu, 1 Oct 2015 08:39:09 +0000 (14:09 +0530)
json_tokener.c

index 8b1e3e6dc2ac14006411f726cd4581fb75658619..98611d63c94dbdc1bfcc707e6b9d8187aa0044bb 100644 (file)
@@ -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;
   }