diff --git a/contrib/interconnect/ic_common.c b/contrib/interconnect/ic_common.c index 0e239107f49..3b68cebf6f4 100644 --- a/contrib/interconnect/ic_common.c +++ b/contrib/interconnect/ic_common.c @@ -48,7 +48,7 @@ SendTupleChunkToAMS(ChunkTransportState * transportStates, int i, recount = 0; ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; TupleChunkListItem currItem; if (!transportStates) @@ -131,7 +131,7 @@ GetTransportDirectBuffer(ChunkTransportState * transportStates, struct directTransportBuffer *b) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; if (!transportStates) { @@ -190,7 +190,7 @@ PutTransportDirectBuffer(ChunkTransportState * transportStates, int16 targetRoute, int length) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; if (!transportStates) { @@ -248,7 +248,7 @@ createChunkTransportState(ChunkTransportState * transportStates, int numConns, size_t chunk_trans_state_entry_size) { - ChunkTransportStateEntry *pEntry; + ChunkTransportStateEntry *pEntry = NULL; int motNodeID; int i; diff --git a/contrib/interconnect/ic_common.h b/contrib/interconnect/ic_common.h index 20b22234f5c..545efa24b0f 100644 --- a/contrib/interconnect/ic_common.h +++ b/contrib/interconnect/ic_common.h @@ -94,7 +94,7 @@ extern ChunkTransportStateEntry *removeChunkTransportState(ChunkTransportState * */ #define doBroadcast(transportStates, pChunkEntry, tcItem, inactiveCountPtr) \ do { \ - MotionConn *conn; \ + MotionConn *conn = NULL; \ int *p_inactive = inactiveCountPtr; \ int i, index, inactive = 0; \ /* add our tcItem to each of the outgoing buffers. */ \ diff --git a/contrib/interconnect/tcp/ic_tcp.c b/contrib/interconnect/tcp/ic_tcp.c index 28c2109a696..d76e34dda25 100644 --- a/contrib/interconnect/tcp/ic_tcp.c +++ b/contrib/interconnect/tcp/ic_tcp.c @@ -502,8 +502,8 @@ startOutgoingConnections(ChunkTransportState * transportStates, ExecSlice * sendSlice, int *pOutgoingCount) { - ChunkTransportStateEntry *pEntry; - MotionConn *conn; + ChunkTransportStateEntry *pEntry = NULL; + MotionConn *conn = NULL; ListCell *cell; ExecSlice *recvSlice; CdbProcess *cdbProc; @@ -905,7 +905,7 @@ readRegisterMessage(ChunkTransportState * transportStates, int iconn; RegisterMessage *regMsg; RegisterMessage msg; - MotionConn *newConn; + MotionConn *newConn = NULL; ChunkTransportStateEntry *pChunkEntry = NULL; ChunkTransportStateEntryTCP *pEntry = NULL; CdbProcess *cdbproc = NULL; @@ -1144,7 +1144,7 @@ acceptIncomingConnection(void) { int newsockfd; socklen_t addrsize; - MotionConn *conn; + MotionConn *conn = NULL; struct sockaddr_storage remoteAddr; struct sockaddr_storage localAddr; MotionConnTCP *tcp_conn = NULL; @@ -1264,8 +1264,8 @@ SetupTCPInterconnect(EState *estate) ListCell *cell; ExecSlice *mySlice; ExecSlice *aSlice; - MotionConn *conn; - MotionConnTCP *tcp_conn; + MotionConn *conn = NULL; + MotionConnTCP *tcp_conn = NULL; SliceTable *sliceTable = estate->es_sliceTable; int incoming_count = 0; int outgoing_count = 0; @@ -1944,7 +1944,7 @@ TeardownTCPInterconnect(ChunkTransportState * transportStates, bool hasErrors) ChunkTransportStateEntry *pEntry = NULL; int i; ExecSlice *mySlice; - MotionConn *conn; + MotionConn *conn = NULL; if (transportStates == NULL || transportStates->sliceTable == NULL) { @@ -2207,8 +2207,8 @@ void dumpEntryConnections(int elevel, ChunkTransportStateEntry * pEntry) { int i; - MotionConn *mConn; - MotionConnTCP *conn; + MotionConn *mConn = NULL; + MotionConnTCP *conn = NULL; for (i = 0; i < pEntry->numConns; i++) { @@ -2401,7 +2401,7 @@ flushInterconnectListenerBacklog(void) static void waitOnOutbound(ChunkTransportStateEntry * pEntry) { - MotionConn *conn; + MotionConn *conn = NULL; struct timeval timeout; mpp_fd_set waitset, @@ -2513,7 +2513,7 @@ DeregisterReadInterestTCP(ChunkTransportState * transportStates, const char *reason) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; if (!transportStates) { @@ -2556,7 +2556,7 @@ void SendStopMessageTCP(ChunkTransportState * transportStates, int16 motNodeID) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; int i; char m = 'S'; ssize_t written; @@ -2740,7 +2740,7 @@ RecvTupleChunkFromTCP(ChunkTransportState * transportStates, int16 srcRoute) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; /* check em' */ ML_CHECK_FOR_INTERRUPTS(transportStates->teardownActive); @@ -2763,7 +2763,7 @@ RecvTupleChunkFromAnyTCP(ChunkTransportState * transportStates, ChunkTransportStateEntry *pChunkEntry = NULL; ChunkTransportStateEntryTCP *pEntry = NULL; TupleChunkListItem tcItem; - MotionConn *conn; + MotionConn *conn = NULL; mpp_fd_set rset; int n, i, @@ -2944,7 +2944,7 @@ SendEOSTCP(ChunkTransportState * transportStates, TupleChunkListItem tcItem) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; int i; if (!transportStates) diff --git a/contrib/interconnect/udp/ic_udpifc.c b/contrib/interconnect/udp/ic_udpifc.c index b125bda62f5..187696386eb 100644 --- a/contrib/interconnect/udp/ic_udpifc.c +++ b/contrib/interconnect/udp/ic_udpifc.c @@ -2671,8 +2671,8 @@ startOutgoingUDPConnections(ChunkTransportState *transportStates, { ChunkTransportStateEntry *pChunkEntry; ChunkTransportStateEntryUDP *pEntry; - MotionConn *mConn; - MotionConnUDP *conn; + MotionConn *mConn = NULL; + MotionConnUDP *conn = NULL; ListCell *cell; ExecSlice *recvSlice; CdbProcess *cdbProc; @@ -3317,7 +3317,7 @@ SetupUDPIFCInterconnect(EState *estate) for (int i = 0; i < ht->size; i++) { struct ConnHtabBin *trash; - MotionConn *conn; + MotionConn *conn = NULL; trash = ht->table[i]; while (trash != NULL) @@ -3457,7 +3457,7 @@ TeardownUDPIFCInterconnect_Internal(ChunkTransportState *transportStates, ChunkTransportStateEntry *pEntry = NULL; int i; ExecSlice *mySlice; - MotionConn *mConn; + MotionConn *mConn = NULL; MotionConnUDP *conn = NULL; uint64 maxRtt = 0; @@ -4334,7 +4334,7 @@ DeregisterReadInterestUDP(ChunkTransportState *transportStates, const char *reason) { ChunkTransportStateEntry *pEntry = NULL; - MotionConn *conn; + MotionConn *conn = NULL; if (!transportStates) { @@ -5872,7 +5872,7 @@ SendEOSUDPIFC(ChunkTransportState *transportStates, { ChunkTransportStateEntry *pChunkEntry = NULL; ChunkTransportStateEntryUDP *pEntry = NULL; - MotionConn *mConn; + MotionConn *mConn = NULL; MotionConnUDP *conn = NULL; int i = 0; int retry = 0; @@ -6922,8 +6922,8 @@ handleMismatch(icpkthdr *pkt, struct sockaddr_storage *peer, int peer_len) static bool cacheFuturePacket(icpkthdr *pkt, struct sockaddr_storage *peer, int peer_len) { - MotionConn *mConn; - MotionConnUDP *conn; + MotionConn *mConn = NULL; + MotionConnUDP *conn = NULL; mConn = findConnByHeader(&ic_control_info.startupCacheHtab, pkt); @@ -7125,8 +7125,8 @@ dumpConnections(ChunkTransportStateEntry *pEntry, const char *fname) { int i, j; - MotionConn *mConn; - MotionConnUDP *conn; + MotionConn *mConn = NULL; + MotionConnUDP *conn = NULL; FILE *ofile = fopen(fname, "w+");