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  <[EMAIL PROTECTED]>

        * 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 ();
 


Reply via email to