Fixed potential double-free

This commit is contained in:
Sam Lantinga 2025-02-05 00:04:45 -08:00
parent 8ba8cca69b
commit b99e19c0a2
1 changed files with 4 additions and 2 deletions

View File

@ -81,10 +81,12 @@ static bool X11_XInput2PenIsEraser(SDL_VideoDevice *_this, int deviceid, char *d
}
if (tooltype_name) {
if (0 == SDL_strcasecmp(tooltype_name, PEN_ERASER_NAME_TAG)) {
if (SDL_strcasecmp(tooltype_name, PEN_ERASER_NAME_TAG) == 0) {
result = true;
}
X11_XFree(tooltype_name_info);
if (tooltype_name != (char *)tooltype_name_info) {
X11_XFree(tooltype_name_info);
}
X11_XFree(tooltype_name);
return result;