| Summary: | Memory leak in SDL_IBus_Init | ||
|---|---|---|---|
| Product: | SDL | Reporter: | alexander.grund |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | 2.0.10 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
When the IBUS initialization fails a string is leaked: ibus_addr_file = SDL_strdup(addr_file); // Allocate memory addr = IBus_ReadAddressFromFile(addr_file); if (!addr) { SDL_free(addr_file); return SDL_FALSE; // This will make the SDL_IBus_Quit not called hence ibus_addr_file is not freed } Possible solution: Move the ibus_addr_file assignment to the bottom and make it conditional on result (only copy if true) Found via LSAN after a simple SDL_InitVideo(); SDL_Quit(); from inside dynamically loaded shared library.