Merged r4121:4122 from branches/SDL-1.2: win32 joystick double-free fix.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 06 Jan 2010 07:26:49 +0000
changeset 3610 3c1b39d0d1a6
parent 3609 72a1c4dda07c
child 3611 57823d017f02
Merged r4121:4122 from branches/SDL-1.2: win32 joystick double-free fix.
src/joystick/win32/SDL_mmjoystick.c
--- a/src/joystick/win32/SDL_mmjoystick.c	Wed Jan 06 06:44:23 2010 +0000
+++ b/src/joystick/win32/SDL_mmjoystick.c	Wed Jan 06 07:26:49 2010 +0000
@@ -362,6 +362,7 @@
     if (joystick->hwdata != NULL) {
         /* free system specific hardware data */
         SDL_free(joystick->hwdata);
+        joystick->hwdata = NULL;
     }
 }
 
@@ -373,6 +374,7 @@
     for (i = 0; i < MAX_JOYSTICKS; i++) {
         if (SYS_JoystickName[i] != NULL) {
             SDL_free(SYS_JoystickName[i]);
+            SYS_JoystickName[i] = NULL;
         }
     }
 }