projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01deec5
)
Initialize new jsonb iterator to zero
author
Peter Eisentraut
<peter_e@gmx.net>
Tue, 29 May 2018 03:53:43 +0000
(23:53 -0400)
committer
Peter Eisentraut
<peter_e@gmx.net>
Tue, 29 May 2018 03:53:43 +0000
(23:53 -0400)
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.
src/backend/utils/adt/jsonb_util.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/utils/adt/jsonb_util.c
b/src/backend/utils/adt/jsonb_util.c
index 2524584d957f140f5f05e60a3b0470fabfb4b17b..3be900f8ee07e7ea2cb5d2600a14330ad91db33a 100644
(file)
--- 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 = palloc
0
(sizeof(JsonbIterator));
it->container = container;
it->parent = parent;
it->nElems = JsonContainerSize(container);