metadataengine/client/src/mdeharvestersession.cpp
changeset 40 910a23996aa0
parent 21 50bf9db68373
child 48 1389872e7c51
--- a/metadataengine/client/src/mdeharvestersession.cpp	Wed Jul 14 07:57:22 2010 +0300
+++ b/metadataengine/client/src/mdeharvestersession.cpp	Fri Jul 23 10:03:59 2010 +0300
@@ -45,6 +45,7 @@
 	{
 	iHarvestingPrioritizationChunk.Close();
 	delete iHarvestingPrioritizationSerializationBuffer;
+	iHarvestingPrioritizationSerializationBuffer = NULL;
 	}
 
 void CMdEHarvesterSession::ConstructL()
@@ -112,12 +113,20 @@
 		}
 
 	// Note: CopyLC doesn't push anything to cleanup stack
-	uri->Des().CopyLC( aUri );
+	TRAPD(err, uri->Des().CopyLC( aUri ));
 
+	if(err != KErrNone)
+	    {
+		delete uri;
+		uri = NULL;
+		return EFalse;
+	    }
+		
 	const TBool ret = iSession->EngineSession().DoSetFileToPresent( 
-			aMediaId, *uri, aFileInfo );
+	aMediaId, *uri, aFileInfo );
 	
 	delete uri;
+	uri = NULL;
 
 	return ret;
 	}