From ab3ec3cf2f952d7c1ae792d59978236832591e77 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 5 Oct 2008 09:41:20 +0000 Subject: [PATCH] Fix potential, but unlikely memory leak. --- stepmania/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp b/stepmania/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp index 0d187c3e1a..504d42212c 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp @@ -29,6 +29,11 @@ void InputHandler_MacOSX_HID::QueueCallback( void *target, int result, void *ref while( (result = CALL(queue, getNextEvent, &event, zeroTime, 0)) == kIOReturnSuccess ) { + if( event.longValueSize != 0 && event.longValue != NULL ) + { + free( event.longValue ); + continue; + } LOG->Trace( "Got event with cookie %p, value %d", event.elementCookie, int(event.value) ); dev->GetButtonPresses( vPresses, event.elementCookie, event.value, now ); }