Fixing another memory leak.

pull/6012/head
Nicolas "Pixel" Noble 9 years ago
parent 5d28d9f63b
commit 959b6f52cd
  1. 4
      src/core/lib/json/json_reader.c
  2. 1
      test/core/json/json_test.c

@ -202,8 +202,10 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
}
if (reader->in_object) {
reader->state = GRPC_JSON_STATE_OBJECT_KEY_BEGIN;
} else {
} else if (reader->in_array) {
reader->state = GRPC_JSON_STATE_VALUE_BEGIN;
} else {
return GRPC_JSON_PARSE_ERROR;
}
} else {
if (reader->depth-- == 0) return GRPC_JSON_PARSE_ERROR;

@ -90,6 +90,7 @@ static testing_pair testing_pairs[] = {
{"{\"foo\": bar\"x\"}", NULL},
{"fals", NULL},
{"0,0 ", NULL},
{"\"foo\",[]", NULL},
/* Testing unterminated string. */
{"\"\\x", NULL},
/* Testing invalid UTF-16 number. */

Loading…
Cancel
Save