Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug: reuse after free.
static should not have been used here.
  • Loading branch information
Parlane committed Jan 15, 2013
1 parent 6f17342 commit 86ee560
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
Expand Up @@ -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());
Expand Down

0 comments on commit 86ee560

Please sign in to comment.