| Summary: | Potential memory leak in SDL_RWFromFile function | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Patrice Mandin <patmandin> |
| Component: | file | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.11 | ||
| Hardware: | All | ||
| OS: | All | ||
Oops, sorry, did not read the whole function. The #ifdef stuff confused me. |
Hello, At the end of the function we got: --8<--8<-- if ( fp == NULL ) { SDL_SetError("Couldn't open %s", file); } else { rwops = SDL_RWFromFP(fp, 1); } #else SDL_SetError("SDL not compiled with stdio support"); #endif /* !HAVE_STDIO_H */ return(rwops); --8<--8<-- In the if() statement, only an error message is set, but the rwops structure is not freed, and set to NULL, before being returned to the calling application.