src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2621 83659de20bf2
parent 2620 4d91a53c6f8a
child 2623 6deba05725ac
     1.1 --- a/src/haptic/win32/SDL_syshaptic.c	Wed Aug 06 09:24:08 2008 +0000
     1.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Wed Aug 06 09:28:07 2008 +0000
     1.3 @@ -565,6 +565,16 @@
     1.4  {
     1.5     int ret;
     1.6  
     1.7 +   /* Allocate the hwdata */
     1.8 +   haptic->hwdata = (struct haptic_hwdata *)
     1.9 +         SDL_malloc(sizeof(*haptic->hwdata));
    1.10 +   if (haptic->hwdata == NULL) {
    1.11 +      SDL_OutOfMemory();
    1.12 +      return -1;
    1.13 +   }
    1.14 +   SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
    1.15 +
    1.16 +   /* Now open the device. */
    1.17     ret = SDL_SYS_HapticOpenFromDevice2( haptic, joystick->hwdata->InputDevice );  
    1.18     if (ret < 0) {
    1.19        return -1;