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

3 views
Skip to first unread message

codesite...@google.com

unread,
Feb 7, 2011, 5:52:10 PM2/7/11
to sipxtapi...@googlegroups.com
Revision: 1429
Author: jaroslavl1
Date: Mon Feb 7 14:43:33 2011
Log: Applied patch from Saab:
- Fixed memory leak: UtlInt was "newed" (UtlInt* pKey = new
UtlInt(serverTask.getTaskId());) but never deleted if successful.
http://code.google.com/p/sipxtapi/source/detail?r=1429

Modified:
/trunk/sipXportLib/src/os/OsSharedServerTaskMgr.cpp

=======================================
--- /trunk/sipXportLib/src/os/OsSharedServerTaskMgr.cpp Wed Oct 22 11:32:45
2008
+++ /trunk/sipXportLib/src/os/OsSharedServerTaskMgr.cpp Mon Feb 7 14:43:33
2011
@@ -88,10 +88,10 @@
return FALSE;
}

- UtlInt* pKey = new UtlInt(serverTask.getTaskId());
+ UtlInt key(serverTask.getTaskId());
OsLock lock(m_memberMutex);
// first try to find if we are already managing it
- OsSharedTaskInfo* pTaskInfo =
dynamic_cast<OsSharedTaskInfo*>(m_managedTaskInfo.find(pKey));
+ OsSharedTaskInfo* pTaskInfo =
dynamic_cast<OsSharedTaskInfo*>(m_managedTaskInfo.find(&key));
if (!pTaskInfo)
{
// add it
@@ -100,12 +100,6 @@
serverTask.taskAttached(this);
return TRUE;
}
- else
- {
- // we are already managing it
- delete pKey;
- pKey = NULL;
- }

return FALSE;
}

Reply all
Reply to author
Forward
0 new messages