Skip to content

Commit 5c5fa63

Browse files
author
Nikita Glukhov
committed
Fix json path array allocation
1 parent 1e1149d commit 5c5fa63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/jsonfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4042,7 +4042,7 @@ jsonb_subscription_evaluate(PG_FUNCTION_ARGS)
40424042
text **path;
40434043
int i = 0;
40444044

4045-
path = (text **) palloc(i * sizeof(text*));
4045+
path = (text **) palloc(sbsdata->indexprNumber * sizeof(text*));
40464046
for (i = 0; i < sbsdata->indexprNumber; i++)
40474047
path[i] = cstring_to_text((char *) DatumGetPointer(sbsdata->upper[i]));
40484048

0 commit comments

Comments
 (0)