Skip to content

Commit 3c9cf06

Browse files
committed
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.
1 parent 01deec5 commit 3c9cf06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/jsonb_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ iteratorFromContainer(JsonbContainer *container, JsonbIterator *parent)
901901
{
902902
JsonbIterator *it;
903903

904-
it = palloc(sizeof(JsonbIterator));
904+
it = palloc0(sizeof(JsonbIterator));
905905
it->container = container;
906906
it->parent = parent;
907907
it->nElems = JsonContainerSize(container);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy