mirror of
https://github.com/yawut/SDL.git
synced 2026-10-24 23:52:39 -05:00
Zero out haptic linked list items on creation
(thanks to Turo Lamminen for the report!)
This commit is contained in:
@@ -282,11 +282,11 @@ MaybeAddDevice(const char *path)
|
||||
return -1;
|
||||
}
|
||||
|
||||
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 -1;
|
||||
}
|
||||
SDL_zerop(item);
|
||||
|
||||
item->fname = SDL_strdup(path);
|
||||
if ( (item->fname == NULL) ) {
|
||||
SDL_free(item->fname);
|
||||
|
||||
Reference in New Issue
Block a user