diff src/joystick/win32/SDL_mmjoystick.c @ 3610:3c1b39d0d1a6

Merged r4121:4122 from branches/SDL-1.2: win32 joystick double-free fix.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 06 Jan 2010 07:26:49 +0000
parents 99210400e8b9
children f7b03b6838cb
line wrap: on
line diff
--- 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;
         }
     }
 }