Fix memory leak in SDL_SendDrop()

main
Mathieu Eyraud 2023-11-10 12:01:57 +01:00 committed by Sam Lantinga
parent dfb87e1099
commit 36b2d2e463
1 changed files with 1 additions and 0 deletions

View File

@ -65,6 +65,7 @@ static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const ch
size_t size = SDL_strlen(data) + 1;
event.drop.data = (char *)SDL_AllocateEventMemory(size);
if (!event.drop.data) {
SDL_free(event.drop.source);
return 0;
}
SDL_memcpy(event.drop.data, data, size);