| Summary: | [PATCH] KMSDRM: Make some pointers NULL after freeing them | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Manuel Alfayate <redwindwanderer2> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | KMSDRM patch to set some pointers to NULL after freeing the memory they point to | ||
Thanks, Fixed in https://hg.libsdl.org/SDL/rev/f65980cb112f Only the part 2/ KMSDRM: change calls free() to SDL_free() (Bug 4529) The 1/ variables are local, it's unnecessary to make them NULL |
Created attachment 3684 [details] KMSDRM patch to set some pointers to NULL after freeing the memory they point to Hi, I'm sending this patch that does two things: 1 - Makes some pointers NULL after being freed manually via SDL_free. This is important because, for example, in KMSDRM_FreeCursor() we are freeing cursor->driverdata, and in KMSDRM_WarpMouseGlobal() we are testing the condition mouse->cur_cursor->driverdata != NULL, so the pointer needs not only to be freed but ALSO nullified. 2 - It changes some free() calls in the kmsdrm code to SDL_free() calls, as they should be. Please merge, thanks!