mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 14:41:58 +00:00
Final fix memleaks in GkClient codes, same for Timer codes.
(these memleaks stop development of gk codes, now i can continue) Fix printHandler 'Unbalanced Structure' issues with locking printHandler data for single thread. ........ Merged revisions 343281 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 343445 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -365,7 +365,7 @@ void ooGkClientFillVendor
|
||||
|
||||
int ooGkClientReceive(ooGkClient *pGkClient)
|
||||
{
|
||||
ASN1OCTET recvBuf[1024];
|
||||
ASN1OCTET recvBuf[ASN_K_ENCBUFSIZ];
|
||||
int recvLen;
|
||||
char remoteHost[32];
|
||||
int iFromPort=0;
|
||||
@@ -376,7 +376,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
|
||||
ast_mutex_lock(&pGkClient->Lock);
|
||||
pctxt = &pGkClient->msgCtxt;
|
||||
|
||||
recvLen = ooSocketRecvFrom(pGkClient->rasSocket, recvBuf, 1024, remoteHost,
|
||||
recvLen = ooSocketRecvFrom(pGkClient->rasSocket, recvBuf, 2048, remoteHost,
|
||||
32, &iFromPort);
|
||||
if(recvLen <0)
|
||||
{
|
||||
@@ -859,7 +859,6 @@ int ooGkClientHandleGatekeeperConfirm
|
||||
memFreePtr(&pGkClient->ctxt, pTimer->cbData);
|
||||
ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList, pTimer);
|
||||
OOTRACEDBGA1("Deleted GRQ Timer.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1064,7 +1063,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
|
||||
allocate storage for endpoint-identifier, and populate it from what the
|
||||
GK told us from the previous RCF. Only allocate on the first pass thru here */
|
||||
pRegReq->endpointIdentifier.data =
|
||||
(ASN116BITCHAR*)memAlloc(pctxt, pGkClient->gkId.nchars*sizeof(ASN116BITCHAR));
|
||||
(ASN116BITCHAR*)memAlloc(pctxt, pGkClient->endpointId.nchars*sizeof(ASN116BITCHAR));
|
||||
if (pRegReq->endpointIdentifier.data) {
|
||||
pRegReq->endpointIdentifier.nchars = pGkClient->endpointId.nchars;
|
||||
pRegReq->m.endpointIdentifierPresent = TRUE;
|
||||
@@ -1137,6 +1136,8 @@ int ooGkClientHandleRegistrationConfirm
|
||||
ooGkClientTimerCb *cbData;
|
||||
ASN1UINT regTTL=0;
|
||||
/* Extract Endpoint Id */
|
||||
if (pGkClient->endpointId.data)
|
||||
memFreePtr(&pGkClient->ctxt, pGkClient->endpointId.data);
|
||||
pGkClient->endpointId.nchars =
|
||||
pRegistrationConfirm->endpointIdentifier.nchars;
|
||||
pGkClient->endpointId.data = (ASN116BITCHAR*)memAlloc(&pGkClient->ctxt,
|
||||
@@ -1289,7 +1290,6 @@ int ooGkClientHandleRegistrationReject
|
||||
memFreePtr(&pGkClient->ctxt, pTimer->cbData);
|
||||
ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList, pTimer);
|
||||
OOTRACEDBGA1("Deleted RRQ Timer.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user