Fix use after free when removing Windows audio device

This commit is contained in:
Mathieu Eyraud authored and Ryan C. Gordon committed 2022-08-02 10:24:11 -04:00
1 parent 59a104b803
commit f1390780ca
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -396,8 +396,9 @@ WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid)
SDL_RemoveAudioDevice(iscapture, i->str);
SDL_free(i->str);
SDL_free(i);
} else {
prev = i;
}
prev = i;
}
}
+2 -1
View File
@@ -108,8 +108,9 @@ SDL_IMMDevice_Remove(const SDL_bool iscapture, LPCWSTR devid, SDL_bool useguid)
SDL_RemoveAudioDevice(iscapture, useguid ? ((void *) i->guid) : ((void *) i->str));
SDL_free(i->str);
SDL_free(i);
} else {
prev = i;
}
prev = i;
}
}