From: SourceForge.net <no...@so...> - 2004-08-02 23:17:40
|
Bugs item #1002324, was opened at 2004-08-02 16:17 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=558446&aid=1002324&group_id=80013 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Linus Upson (lostupdate) Assigned to: Nobody/Anonymous (nobody) Summary: throwing exception leaks string Initial Comment: If you build with _UNICODE defined on Windows the _THROWX() macro is defined as follows: #define _THROWX(y) throw THROW_TYPE (Misc::wideToChar(y)) Misc::wideToChar() allocates a buffer which is not deleted when the exception is caught inside of clucene_dll.cpp. Here is an example stack trace: lucene::util::Misc::wideToChar(WORD const*) [misc.cpp:25] //static char* Misc::wideToChar(const wchar_t* s){ int len = wcslen(s); => char* msg=new char[len+1]; wideToChar( s,msg,len+1 ); return msg; } lucene::store::FSDirectory::FSDirectory(WORD const*,bool) [fsdirectory.cpp:137] if (!lucene::util::Misc::dir_Exists(directory)){ StringBuffer e(path); e.append(_T(" not a directory")); => _THROWX( e.getBuffer()); } } CL_U_Unlock [clucene_dll.cpp:638] resetError(-1); int ret = 0; try{ => FSDirectory dir(directory,false); IndexReader::unlock(dir); ret = 1; }catch(exception e){ ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=558446&aid=1002324&group_id=80013 |