From cb78faa5273600ce7c750f5c245736b8410f6ede Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Wed, 25 Aug 2010 10:36:12 +0200 Subject: fix leak if lightshare message not valid --- linden/indra/newview/lightshare.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'linden/indra/newview/lightshare.cpp') diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index 4f8b1e2..b00df96 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp @@ -63,8 +63,7 @@ WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : return; // Wrong message type, somehow. } - S32 size = msg->getSizeFast(_PREHASH_ParamList, 0, - _PREHASH_Parameter); + S32 size = msg->getSizeFast(_PREHASH_ParamList, 0, _PREHASH_Parameter); if( size < 0 || 250 < size ) { @@ -74,8 +73,8 @@ WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : // Unpack and process the message's binary payload. char buf[250]; msg->getBinaryDataFast(_PREHASH_ParamList, - _PREHASH_Parameter, - buf, size, 0, 249); + _PREHASH_Parameter, + buf, size, 0, 249); mWater = new LLWaterParamSet(); // mSky = new LLWLParamSet(); @@ -110,9 +109,15 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) WindlightMessage* wl = new WindlightMessage(msg); - if( !wl->isValid() ) + if (!wl) return; + if(!wl->isValid() ) + { + delete wl; + return; + } + std::string water = LLWaterParamManager::instance()->mCurParams.mName; std::string sky = LLWLParamManager::instance()->mCurParams.mName; -- cgit v1.1