Don't duplicate the serial number twice if a child doesn't set one

main
Sam Lantinga 2022-08-09 09:03:28 -07:00
parent d90c0d41cc
commit 201484ff6f
1 changed files with 2 additions and 0 deletions

View File

@ -94,6 +94,8 @@ HIDAPI_DriverCombined_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys
serial = new_serial;
serial_length = new_length;
}
SDL_free(joystick->serial);
joystick->serial = NULL;
}
}