Content-Length: 258613 | pFad | http://github.com/postgrespro/postgres_cluster/commit/3c9cf069454d80b0b4a54a0a90941a88a97b1122

5B Initialize new jsonb iterator to zero · postgrespro/postgres_cluster@3c9cf06 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/3c9cf069454d80b0b4a54a0a90941a88a97b1122

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy