stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r699069 - /stdcxx/branches/4.2.x/src/collate.cpp
Date Thu, 25 Sep 2008 19:58:11 GMT
Author: sebor
Date: Thu Sep 25 12:58:10 2008
New Revision: 699069

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

	* src/collate.cpp (__rw_wcsnxfrm): 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=699069&r1=699068&r2=699069&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/collate.cpp (original)
+++ stdcxx/branches/4.2.x/src/collate.cpp Thu Sep 25 12:58:10 2008
@@ -746,8 +746,12 @@
             _RWSTD_WCSXFRM (just_in_case_buf, psrc, 0);
 
         // check for wcsxfrm() errors
-        if (_RWSTD_SIZE_MAX == dst_size)
+        if (_RWSTD_SIZE_MAX == dst_size) {
+            if (pbuf != buf)
+                delete[] pbuf;
+
             return _STD::wstring ();
+        }
 
         size_t res_size = res.size ();
 



Mime
View raw message