diff options
author | Peter Eisentraut | 2018-05-29 03:53:43 +0000 |
---|---|---|
committer | Peter Eisentraut | 2018-05-29 03:53:43 +0000 |
commit | 3c9cf069454d80b0b4a54a0a90941a88a97b1122 (patch) | |
tree | f1ad0710714cf8cfe5b9c0f22f500e3b6a5990b1 | |
parent | 01deec5f8ae64b5120cc8c93d54fe0e19e477b02 (diff) |
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.
-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); |