mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-20 03:47:12 +00:00
Fix memory leak in SDL_SendDrop()
This commit is contained in:
committed by
Sam Lantinga
parent
dfb87e1099
commit
36b2d2e463
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user