OOCTXT* newContext () { OOCTXT* pctxt = (OOCTXT*) ASN1CRTMALLOC0 (sizeof(OOCTXT)); if (pctxt) { if (initContext(pctxt) != ASN_OK) { ASN1CRTFREE0 (pctxt); pctxt = 0; } pctxt->flags |= ASN1DYNCTXT; } return (pctxt); }
void errFreeParms (ASN1ErrInfo* pErrInfo) { #if defined(_NO_THREADS) || !defined(_NO_MALLOC) int i; for (i = 0; i < pErrInfo->parmcnt; i++) ASN1CRTFREE0 ((char*)pErrInfo->parms[i]); #endif pErrInfo->parmcnt = 0; pErrInfo->status = 0; }
int ooCleanCall(OOH323CallData *call) { OOCTXT *pctxt; OOTRACEWARN4 ("Cleaning Call (%s, %s)- reason:%s\n", call->callType, call->callToken, ooGetReasonCodeText (call->callEndReason)); /* First clean all the logical channels, if not already cleaned. */ if(call->logicalChans) ooClearAllLogicalChannels(call); /* Close H.245 connection, if not already closed */ if(call->h245SessionState != OO_H245SESSION_CLOSED) ooCloseH245Connection(call); else{ if(call->pH245Channel && call->pH245Channel->outQueue.count > 0) { dListFreeAll(call->pctxt, &(call->pH245Channel->outQueue)); memFreePtr(call->pctxt, call->pH245Channel); } } /* Close H.245 listener, if not already closed */ if(call->h245listener) { ooCloseH245Listener(call); } /* Close H225 connection, if not already closed. */ if (0 != call->pH225Channel && 0 != call->pH225Channel->sock) { ooCloseH225Connection(call); } /* Clean timers */ if(call->timerList.count > 0) { dListFreeAll(call->pctxt, &(call->timerList)); } if(gH323ep.gkClient && !OO_TESTFLAG(call->flags, OO_M_DISABLEGK)) { ooGkClientCleanCall(gH323ep.gkClient, call); } ooRemoveCallFromList (call); OOTRACEINFO3("Removed call (%s, %s) from list\n", call->callType, call->callToken); if(call->pCallFwdData && call->pCallFwdData->fwdedByRemote) { if(gH323ep.h323Callbacks.onCallForwarded) gH323ep.h323Callbacks.onCallForwarded(call); if(ooH323HandleCallFwdRequest(call)!= OO_OK) { OOTRACEERR3("Error:Failed to forward call (%s, %s)\n", call->callType, call->callToken); } } else { if(gH323ep.h323Callbacks.onCallCleared) gH323ep.h323Callbacks.onCallCleared(call); } pctxt = call->pctxt; freeContext(pctxt); ASN1CRTFREE0(pctxt); return OO_OK; }