mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Initialize new jsonb iterator to zero
Use palloc0() instead of palloc() to create a new JsonbIterator. Otherwise, the isScalar field is sometimes not initialized. There is probably no impact in practice, but it's cleaner this way and it avoids future problems.
This commit is contained in:
@ -901,7 +901,7 @@ iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent)
|
||||
{
|
||||
JsonbIterator *it;
|
||||
|
||||
it = palloc(sizeof(JsonbIterator));
|
||||
it = palloc0(sizeof(JsonbIterator));
|
||||
it->container = container;
|
||||
it->parent = parent;
|
||||
it->nElems = JsonContainerSize(container);
|
||||
|
Reference in New Issue
Block a user