summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-01-15 22:27:49 +1300
committerMatthew Parlane <parlane@gmail.com>2013-01-15 22:27:49 +1300
commit86ee5600dc9f77bfef73f72b09e59ee3823c28a3 (patch)
treed836f4b4ae69768a1c50c7196253556eda98fe06 /Source/Core
parent6f17342b50bafc531d5005819b41dcafb3b5f545 (diff)
Fix bug: reuse after free.
static should not have been used here.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
index 49684ef5af..545002f914 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
@@ -787,9 +787,10 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
}
else
{
- static CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb = GetUsbPointer();
- bool* wiiMoteConnected = new bool[s_Usb->m_WiiMotes.size()];
- for (unsigned int i = 0; i < s_Usb->m_WiiMotes.size(); i++)
+ CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb = GetUsbPointer();
+ size_t size = s_Usb->m_WiiMotes.size();
+ bool* wiiMoteConnected = new bool[size];
+ for (unsigned int i = 0; i < size; i++)
wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected();
std::string tContentFile(m_ContentFile.c_str());