Fix memory leak in SDL_SendDrop()

This commit is contained in:
Mathieu Eyraud authored and Sam Lantinga committed 2023-11-10 06:32:43 -08:00
1 parent dfb87e1099
commit 36b2d2e463
1 file changed
+1
+1
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);