From b12226e8789e314c11f48d8120829e67d0045297 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Apr 2008 16:36:00 -0600 Subject: [PATCH] make private copy of libraryName in BuiltinElement --- src/finder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/finder.cpp b/src/finder.cpp index 02159f2e96..603578e645 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -443,7 +443,7 @@ class BuiltinElement: public JarElement { BuiltinElement(System* s, const char* name, unsigned nameLength, const char* libraryName): JarElement(s, name, nameLength), - libraryName(libraryName) + libraryName(libraryName ? copy(s, &libraryNameLength, libraryName) : 0) { } virtual void init() { @@ -469,10 +469,12 @@ class BuiltinElement: public JarElement { virtual void dispose() { JarElement::dispose(); library->disposeAll(); + free(s, libraryName, libraryNameLength + 1); } System::Library* library; const char* libraryName; + unsigned libraryNameLength; }; Element*