diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-07-16 08:42:15 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-07-16 08:50:49 +0200 |
commit | 9fd45870c1436b477264c0c82eb195df52bc0919 (patch) | |
tree | 10a09724c0bcffa8f58f262e50c3260cde484446 /src/backend/utils/adt/acl.c | |
parent | c94ae9d827a360d74da6a304692d34a4dc8b6445 (diff) | |
download | postgresql-9fd45870c1436b477264c0c82eb195df52bc0919.tar.gz postgresql-9fd45870c1436b477264c0c82eb195df52bc0919.zip |
Replace many MemSet calls with struct initialization
This replaces all MemSet() calls with struct initialization where that
is easily and obviously possible. (For example, some cases have to
worry about padding bits, so I left those.)
(The same could be done with appropriate memset() calls, but this
patch is part of an effort to phase out MemSet(), so it doesn't touch
memset() calls.)
Reviewed-by: Ranier Vilela <ranier.vf@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/9847b13c-b785-f4e2-75c3-12ec77a3b05c@enterprisedb.com
Diffstat (limited to 'src/backend/utils/adt/acl.c')
-rw-r--r-- | src/backend/utils/adt/acl.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index b7fd3bcf057..6fa58dd8eb0 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -1785,7 +1785,7 @@ aclexplode(PG_FUNCTION_ARGS) { Datum result; Datum values[4]; - bool nulls[4]; + bool nulls[4] = {0}; HeapTuple tuple; values[0] = ObjectIdGetDatum(aidata->ai_grantor); @@ -1793,8 +1793,6 @@ aclexplode(PG_FUNCTION_ARGS) values[2] = CStringGetTextDatum(convert_aclright_to_string(priv_bit)); values[3] = BoolGetDatum((ACLITEM_GET_GOPTIONS(*aidata) & priv_bit) != 0); - MemSet(nulls, 0, sizeof(nulls)); - tuple = heap_form_tuple(funcctx->tuple_desc, values, nulls); result = HeapTupleGetDatum(tuple); |