Fix memory leak in SDL_SendDrop()
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;
|
size_t size = SDL_strlen(data) + 1;
|
||||||
event.drop.data = (char *)SDL_AllocateEventMemory(size);
|
event.drop.data = (char *)SDL_AllocateEventMemory(size);
|
||||||
if (!event.drop.data) {
|
if (!event.drop.data) {
|
||||||
|
SDL_free(event.drop.source);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
SDL_memcpy(event.drop.data, data, size);
|
SDL_memcpy(event.drop.data, data, size);
|
||||||
|
|
Loading…
Reference in New Issue