]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/list.cpp
fixing overrelease and out-of-bounds write, fixes #13725
[wxWidgets.git] / src / common / list.cpp
index 8049c945fbdb97b776ac2554ddc22c9bfd608b7a..58c38ea33a856e912446ae9a750cd3ebff93bb50 100644 (file)
@@ -171,22 +171,18 @@ void wxListBase::DoCopy(const wxListBase& list)
     {
         case wxKEY_INTEGER:
             {
-                long key;
                 for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() )
                 {
-                    key = node->GetKeyInteger();
-                    Append(key, node->GetData());
+                    Append(node->GetKeyInteger(), node->GetData());
                 }
                 break;
             }
 
         case wxKEY_STRING:
             {
-                const wxChar *key;
                 for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() )
                 {
-                    key = node->GetKeyString();
-                    Append(key, node->GetData());
+                    Append(node->GetKeyString(), node->GetData());
                 }
                 break;
             }
@@ -766,6 +762,6 @@ void _WX_LIST_HELPER_wxStringListBase::DeleteFunction( wxString WXUNUSED(X) )
 {
 }
 
-wxStringListBase::BaseListType wxStringListBase::EmptyList;
+_WX_LIST_HELPER_wxStringListBase::BaseListType _WX_LIST_HELPER_wxStringListBase::EmptyList;
 
 #endif // !wxUSE_STD_CONTAINERS