Zero out haptic linked list items on creation
(thanks to Turo Lamminen for the report!)
This commit is contained in:
parent
ac487a8eec
commit
9faed54ab1
3 changed files with 4 additions and 7 deletions
|
@ -237,7 +237,7 @@ MacHaptic_MaybeAddDevice( io_object_t device )
|
|||
}
|
||||
}
|
||||
|
||||
item = (SDL_hapticlist_item *)SDL_malloc( sizeof(SDL_hapticlist_item));
|
||||
item = (SDL_hapticlist_item *)SDL_calloc(1, sizeof(SDL_hapticlist_item));
|
||||
if (item == NULL) {
|
||||
return SDL_SetError("Could not allocate haptic storage");
|
||||
}
|
||||
|
@ -248,7 +248,6 @@ MacHaptic_MaybeAddDevice( io_object_t device )
|
|||
/* Set basic device data. */
|
||||
HIDGetDeviceProduct(device, item->name);
|
||||
item->dev = device;
|
||||
item->haptic = NULL;
|
||||
|
||||
/* Set usage pages. */
|
||||
hidProperties = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue