index cfb923aaa35cdfa0371b3fa3d3500edd349451a1..5868aad0578f0bb016a9d49e40da87145ca40d1d 100644 (file)
@@ -283,7 +283,7 @@ jsonb_subscript_assign(ExprState *state,
*/
if (*op->resnull)
{
- JsonbValue *newSource = (JsonbValue *) palloc(sizeof(JsonbValue));
+ JsonbValue newSource;
/*
* To avoid any surprising results, set up an empty jsonb array in
*/
if (workspace->expectArray)
{
- newSource->type = jbvArray;
- newSource->val.array.nElems = 0;
- newSource->val.array.rawScalar = false;
+ newSource.type = jbvArray;
+ newSource.val.array.nElems = 0;
+ newSource.val.array.rawScalar = false;
}
else
{
- newSource->type = jbvObject;
- newSource->val.object.nPairs = 0;
+ newSource.type = jbvObject;
+ newSource.val.object.nPairs = 0;
}
- jsonbSource = JsonbValueToJsonb(newSource);
+ jsonbSource = JsonbValueToJsonb(&newSource);
*op->resnull = false;
}
else