[reSIProcate] Potential memory leak in EncryptionManager::process

Byron Campen bcampen at estacado.net
Wed Mar 7 15:51:34 CST 2007


	Here's the code I'm worried about:

in EncryptionManager::process(Message* msg)
*snip*
       if (contents)
       {
          if (setContents)
          {
             event->message()->setContents(auto_ptr<Contents> 
(contents));
             DumHelper::setEncryptionPerformed(*event->message());
          }
          return DumFeature::FeatureDone;
       }
       else
       {
          if (noCerts)
          {
             return DumFeature::ChainDoneAndEventDone;
          }
          else
          {
             //event->releaseMessage();
             return DumFeature::EventTaken;
          }
       }
*snip*

	It is my understanding that a return of EventTaken denotes that the  
DumFeature has taken ownership of msg (event is msg cast to an  
OutgoingEvent*). However, in this case it has not taken ownership at  
all. At no point in the preceding code do we store the pointer, and  
we don't delete it before the return. Now, I am not even sure this  
code-path is reachable, but wouldn't it be a good idea to fix this  
anyway?

Best regards,
Byron Campen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20070307/c0ef3d4b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2423 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20070307/c0ef3d4b/attachment.bin>


More information about the resiprocate-devel mailing list