Fix for memory leak in UL data path at cu_stub [Issue-ID: ODUHIGH-398]
[o-du/l2.git] / src / cu_stub / cu_stub_sctp.c
index 452e318..fc0fe3b 100644 (file)
@@ -404,6 +404,7 @@ S16 sctpSockPoll()
    CmInetAddr    egtpFromAddr;
    CmInetMemInfo memInfo;
    sctpSockPollParams f1PollParams;
+   uint64_t      numMsgRcvd = 0;
 
    memset(&f1PollParams, 0, sizeof(sctpSockPollParams));
     
@@ -438,8 +439,9 @@ S16 sctpSockPoll()
       ret = cmInetRecvMsg(&(egtpCb.recvTptSrvr.sockFd), &egtpFromAddr, &memInfo, &egtpBuf, &egtpBufLen, CM_INET_NO_FLAG);
       if(ret == ROK && egtpBuf != NULLP)
       {
-         DU_LOG("\nINFO  -->  EGTP : Received message \n");
-         ODU_PRINT_MSG(egtpBuf, 0 ,0);
+         DU_LOG("\nINFO  -->  EGTP : Received UL Message [%ld]\n", numMsgRcvd+1);
+         numMsgRcvd++;
+         //ODU_PRINT_MSG(egtpBuf, 0 ,0);
          cuEgtpHdlRecvMsg(egtpBuf);
 
       }
@@ -525,10 +527,11 @@ S16 processPolling(sctpSockPollParams *pollParams, CmInetFd *sockFd, uint32_t *t
  * ****************************************************************/
 S16 sctpSend(Buffer *mBuf)
 {
-   uint8_t          ret;
-   MsgLen           len;          /* number of actually sent octets */
+   uint8_t          ret = ROK;
+   MsgLen           len = 0;          /* number of actually sent octets */
    CmInetMemInfo    memInfo;                        
-   
+  
+   memset(&memInfo , 0, sizeof(CmInetMemInfo));
    memInfo.region = CU_APP_MEM_REG;               
    memInfo.pool   = CU_POOL;