diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-03-25 09:35:22 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-03-25 09:36:58 +0100 |
commit | 572e3e6634e55accf95e2bcfb1340019c86a21dc (patch) | |
tree | 372282411158a042be11024c0fecf1a3eb72ca30 | |
parent | 9a8ee1dc650be623c32b1df103254847be974d01 (diff) | |
download | postgresql-572e3e6634e55accf95e2bcfb1340019c86a21dc.tar.gz postgresql-572e3e6634e55accf95e2bcfb1340019c86a21dc.zip |
Initialize structure at declaration
Avoids extra memset call and cast.
Discussion: https://www.postgresql.org/message-id/flat/7a5cbea7-b8df-e910-0f10-04014bcad701%402ndquadrant.com
-rw-r--r-- | contrib/dblink/dblink.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index d95e6bfa715..d35e5ba3d88 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -982,13 +982,11 @@ materializeQueryResult(FunctionCallInfo fcinfo, { ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; PGresult *volatile res = NULL; - volatile storeInfo sinfo; + volatile storeInfo sinfo = {0}; /* prepTuplestoreResult must have been called previously */ Assert(rsinfo->returnMode == SFRM_Materialize); - /* initialize storeInfo to empty */ - memset((void *) &sinfo, 0, sizeof(sinfo)); sinfo.fcinfo = fcinfo; PG_TRY(); |