diff options
Diffstat (limited to 'src/backend/access/common/heaptuple.c')
| -rw-r--r-- | src/backend/access/common/heaptuple.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index 1967b047020..b7820d692e2 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -1230,8 +1230,8 @@ heap_modify_tuple(HeapTuple tuple, * O(N^2) if there are many non-replaced columns, so it seems better to * err on the side of linear cost. */ - values = (Datum *) palloc(numberOfAttributes * sizeof(Datum)); - isnull = (bool *) palloc(numberOfAttributes * sizeof(bool)); + values = palloc_array(Datum, numberOfAttributes); + isnull = palloc_array(bool, numberOfAttributes); heap_deform_tuple(tuple, tupleDesc, values, isnull); @@ -1292,8 +1292,8 @@ heap_modify_tuple_by_cols(HeapTuple tuple, * allocate and fill values and isnull arrays from the tuple, then replace * selected columns from the input arrays. */ - values = (Datum *) palloc(numberOfAttributes * sizeof(Datum)); - isnull = (bool *) palloc(numberOfAttributes * sizeof(bool)); + values = palloc_array(Datum, numberOfAttributes); + isnull = palloc_array(bool, numberOfAttributes); heap_deform_tuple(tuple, tupleDesc, values, isnull); |
