From eeb30616f601a8e75403d7eb8ffed272a5915a17 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 27 Jan 2010 13:26:05 -0800
Subject: CID-99

Checker: INVALIDATE_ITERATOR
Function: LLAllocatorHeapProfile::parse(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
File: /indra/llcommon/llallocator_heap_profile.cpp

not a bug, but make it clearer to coverity.
---
 indra/llcommon/llallocator_heap_profile.cpp | 31 ++++++++++++++++-------------
 1 file changed, 17 insertions(+), 14 deletions(-)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp
index 0a807702d0..d01b33c8c4 100644
--- a/indra/llcommon/llallocator_heap_profile.cpp
+++ b/indra/llcommon/llallocator_heap_profile.cpp
@@ -113,20 +113,23 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text)
         ++j;
 
         while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
-        llassert_always(j != line_elems.end());
-        ++j; // skip the '@'
-
-        mLines.push_back(line(live_count, live_size, tot_count, tot_size));
-        line & current_line = mLines.back();
-
-        for(; j != line_elems.end(); ++j)
-        {
-            if(!j->empty()) {
-                U32 marker = boost::lexical_cast<U32>(*j);
-                current_line.mTrace.push_back(marker);
-            }
-        }
-    }
+	llassert(j != line_elems.end());
+        if (j != line_elems.end())
+	{
+		++j; // skip the '@'
+
+		mLines.push_back(line(live_count, live_size, tot_count, tot_size));
+		line & current_line = mLines.back();
+		
+		for(; j != line_elems.end(); ++j)
+		{
+			if(!j->empty())
+			{
+				U32 marker = boost::lexical_cast<U32>(*j);
+				current_line.mTrace.push_back(marker);
+			}
+		}
+	}
 
     // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it
 }
-- 
cgit v1.2.3