[sipxtapi] r1431 committed - Applied patch from Saab:...

6 views
Skip to first unread message

codesite...@google.com

unread,
Feb 7, 2011, 6:00:17 PM2/7/11
to sipxtapi...@googlegroups.com
Revision: 1431
Author: jaroslavl1
Date: Mon Feb 7 14:48:18 2011
Log: Applied patch from Saab:
- Check piSDESReport for NULL - experienced a NULL reference proplem in
some rare cases. Should probably log.
- Setting m_oiSDESReport to NULL in destructor - experienced a memory
access violation if sipxUnInitialize was called followed by sipxInitialize
without terminating process.

http://code.google.com/p/sipxtapi/source/detail?r=1431

Modified:
/trunk/sipXmediaLib/src/rtcp/RTCManager.cpp
/trunk/sipXmediaLib/src/rtcp/RTCPSession.cpp
/trunk/sipXmediaLib/src/rtcp/SourceDescription.cpp

=======================================
--- /trunk/sipXmediaLib/src/rtcp/RTCManager.cpp Wed Oct 22 11:32:45 2008
+++ /trunk/sipXmediaLib/src/rtcp/RTCManager.cpp Mon Feb 7 14:48:18 2011
@@ -65,16 +65,19 @@
ISDESReport *piSDESReport =
(ISDESReport
*)CSourceDescription::GetLocalSDES();

- if((m_spoRTCManager = new CRTCManager(piSDESReport)) == NULL)
- {
+ if(piSDESReport != NULL)
+ {
+ if((m_spoRTCManager = new CRTCManager(piSDESReport)) == NULL)
+ {
osPrintf("**** FAILURE **** CRTCManager::getRTCPControl() -"
- " RTCManager Object Creation
Failed\n");
+ " RTCManager Object Creation Failed\n");
piSDESReport->Release();
return(NULL);
- }
-
- // Release Reference to SDES Report
- piSDESReport->Release();
+ }
+
+ // Release Reference to SDES Report
+ piSDESReport->Release();
+ }
}

// Check whether the RTCManager object has been initialized.
@@ -98,7 +101,6 @@
m_spoRTCManager->AddRef();

return((IRTCPControl *)m_spoRTCManager);
-
}


@@ -172,7 +174,10 @@

// Release Source Description object reference
if(m_piSDESReport)
+ {
m_piSDESReport->Release();
+ m_piSDESReport = NULL;
+ }

// Iterate through the EventRegistration List and release all
references
// to objects contained therein
@@ -349,7 +354,6 @@
" Unable to create CRTCPSession
object\n");
return(NULL);
}
-
// Initialize RTCP Session object
else if(!poRTCPSession->Initialize())
{
=======================================
--- /trunk/sipXmediaLib/src/rtcp/RTCPSession.cpp Fri Jan 8 14:50:06 2010
+++ /trunk/sipXmediaLib/src/rtcp/RTCPSession.cpp Mon Feb 7 14:48:18 2011
@@ -253,7 +253,7 @@
poRTCPConnection->Terminate();

// Release reference twice. Once for its removal from the
collection
- // and once on behalf fo the client since this method serves to
+ // and once on behalf of the client since this method serves to
// terminate the connection and release the client's reference.
((IRTCPConnection *)poRTCPConnection)->Release();
((IRTCPConnection *)poRTCPConnection)->Release();
@@ -384,7 +384,7 @@
poRTCPConnection->Terminate();

// Release reference twice. Once for its removal from the
collection
- // and once on behalf fo the client since this method serves to
+ // and once on behalf of the client since this method serves to
// terminate the connection and release the client's reference.
((IRTCPConnection *)poRTCPConnection)->Release();
((IRTCPConnection *)poRTCPConnection)->Release();
=======================================
--- /trunk/sipXmediaLib/src/rtcp/SourceDescription.cpp Wed Oct 22 11:32:45
2008
+++ /trunk/sipXmediaLib/src/rtcp/SourceDescription.cpp Mon Feb 7 14:48:18
2011
@@ -96,10 +96,9 @@
}

// sLock.release();
-
// Bump the reference count to this object
m_spoLocalSDES->AddRef();
-
+
return(m_spoLocalSDES);

}
@@ -235,6 +234,7 @@
{
// Our reference count must have gone to 0 to get here. We have not
allocated
// any memory so we shall now go quietly into that good night!
+ m_spoLocalSDES = NULL;
}


Reply all
Reply to author
Forward
0 new messages