stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r700162 - /stdcxx/branches/4.2.x/src/collate.cpp
Date Mon, 29 Sep 2008 16:14:44 GMT
Author: sebor
Date: Mon Sep 29 09:14:44 2008
New Revision: 700162

URL: http://svn.apache.org/viewvc?rev=700162&view=rev
Log:
2008-09-29  Martin Sebor  <sebor@apache.org>

	* src/collate.cpp (__rw_strnxfrm): Plugged a memory leak.

Modified:
    stdcxx/branches/4.2.x/src/collate.cpp

Modified: stdcxx/branches/4.2.x/src/collate.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/collate.cpp?rev=700162&r1=700161&r2=700162&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/collate.cpp (original)
+++ stdcxx/branches/4.2.x/src/collate.cpp Mon Sep 29 09:14:44 2008
@@ -536,8 +536,12 @@
         const size_t dst_size = strxfrm (just_in_case_buf, psrc, 0);
 
         // check for strxfrm() errors
-        if (0 == (dst_size << 1))
+        if (0 == (dst_size << 1)) {
+            if (pbuf != buf)
+                delete[] pbuf;
+
             return _STD::string ();
+        }
 
         size_t res_size = res.size ();
 



Mime
View raw message