Kaydet (Commit) fca5e099 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

coverity#982975 and more: fix memory leaks

Change-Id: I4c147ea03eb4d5d7c926ec1cccbd344ff28c77d7
üst 5ff1afbf
...@@ -114,7 +114,9 @@ MediatorMessage* PluginConnector::Transact( const char* pFunction, ...@@ -114,7 +114,9 @@ MediatorMessage* PluginConnector::Transact( const char* pFunction,
va_start( ap, nFunctionLen ); va_start( ap, nFunctionLen );
sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap );
va_end( ap ); va_end( ap );
return TransactMessage( nSize, pBuffer ); MediatorMessage* pRet = TransactMessage( nSize, pBuffer );
delete[] pBuffer;
return pRet;
} }
MediatorMessage* PluginConnector::Transact( sal_uInt32 nFunction, ... ) MediatorMessage* PluginConnector::Transact( sal_uInt32 nFunction, ... )
...@@ -125,7 +127,9 @@ MediatorMessage* PluginConnector::Transact( sal_uInt32 nFunction, ... ) ...@@ -125,7 +127,9 @@ MediatorMessage* PluginConnector::Transact( sal_uInt32 nFunction, ... )
va_start( ap, nFunction ); va_start( ap, nFunction );
sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap );
va_end( ap ); va_end( ap );
return TransactMessage( nSize, pBuffer ); MediatorMessage* pRet = TransactMessage( nSize, pBuffer );
delete[] pBuffer;
return pRet;
} }
sal_uLong PluginConnector::Send( sal_uInt32 nFunction, ... ) sal_uLong PluginConnector::Send( sal_uInt32 nFunction, ... )
...@@ -136,7 +140,9 @@ sal_uLong PluginConnector::Send( sal_uInt32 nFunction, ... ) ...@@ -136,7 +140,9 @@ sal_uLong PluginConnector::Send( sal_uInt32 nFunction, ... )
va_start( ap, nFunction ); va_start( ap, nFunction );
sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap );
va_end( ap ); va_end( ap );
return SendMessage( nSize, pBuffer ); sal_uLong nRet = SendMessage( nSize, pBuffer );
delete[] pBuffer;
return nRet;
} }
void PluginConnector::Respond( sal_uLong nID, void PluginConnector::Respond( sal_uLong nID,
...@@ -150,6 +156,7 @@ void PluginConnector::Respond( sal_uLong nID, ...@@ -150,6 +156,7 @@ void PluginConnector::Respond( sal_uLong nID,
sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap );
va_end( ap ); va_end( ap );
SendMessage( nSize, pBuffer, nID | ( 1 << 24 ) ); SendMessage( nSize, pBuffer, nID | ( 1 << 24 ) );
delete[] pBuffer;
} }
MediatorMessage* PluginConnector::WaitForAnswer( sal_uLong nMessageID ) MediatorMessage* PluginConnector::WaitForAnswer( sal_uLong nMessageID )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment