diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-05-28 23:53:43 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-05-28 23:53:43 -0400 |
commit | 3c9cf069454d80b0b4a54a0a90941a88a97b1122 (patch) | |
tree | f1ad0710714cf8cfe5b9c0f22f500e3b6a5990b1 /src/backend/utils/adt/jsonb_util.c | |
parent | 01deec5f8ae64b5120cc8c93d54fe0e19e477b02 (diff) | |
download | postgresql-3c9cf069454d80b0b4a54a0a90941a88a97b1122.tar.gz postgresql-3c9cf069454d80b0b4a54a0a90941a88a97b1122.zip |
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.
Diffstat (limited to 'src/backend/utils/adt/jsonb_util.c')
-rw-r--r-- | src/backend/utils/adt/jsonb_util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/jsonb_util.c b/src/backend/utils/adt/jsonb_util.c index 2524584d957..3be900f8ee0 100644 --- a/src/backend/utils/adt/jsonb_util.c +++ b/src/backend/utils/adt/jsonb_util.c @@ -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); |