| 421 | } |
| 422 | |
| 423 | static int redisReaderGrow(redisReader *r) { |
| 424 | redisReadTask **aux; |
| 425 | int newlen; |
| 426 | |
| 427 | /* Grow our stack size */ |
| 428 | newlen = r->tasks + REDIS_READER_STACK_SIZE; |
| 429 | aux = hi_realloc(r->task, sizeof(*r->task) * newlen); |
| 430 | if (aux == NULL) |
| 431 | goto oom; |
| 432 | |
| 433 | r->task = aux; |
| 434 | |
| 435 | /* Allocate new tasks */ |
| 436 | for (; r->tasks < newlen; r->tasks++) { |
| 437 | r->task[r->tasks] = hi_calloc(1, sizeof(**r->task)); |
| 438 | if (r->task[r->tasks] == NULL) |
| 439 | goto oom; |
| 440 | } |
| 441 | |
| 442 | return REDIS_OK; |
| 443 | oom: |
| 444 | __redisReaderSetErrorOOM(r); |
| 445 | return REDIS_ERR; |
| 446 | } |
| 447 | |
| 448 | /* Process the array, map and set types. */ |
| 449 | static int processAggregateItem(redisReader *r) { |
no test coverage detected