We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3723 - Possible double free in kmsdrm init code on certain errors
Summary: Possible double free in kmsdrm init code on certain errors
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 normal
Assignee: Brandon Schaefer
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-04 01:52 UTC by Simon Hug
Modified: 2017-08-11 17:06 UTC (History)
0 users

See Also:


Attachments
Patch that fixes the possible double frees in the kmsdrm init code. (518 bytes, patch)
2017-08-04 01:52 UTC, Simon Hug
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hug 2017-08-04 01:52:20 UTC
Created attachment 2817 [details]
Patch that fixes the possible double frees in the kmsdrm init code.

KMSDRM_VideoInit allocates and frees some connectors and encoders but doesn't set the pointer to NULL after freeing. The cleanup code at the end may free one of those garbage pointer should an error happen in the initialization.

Attached patch adds some NULL assignments.
Comment 1 Sam Lantinga 2017-08-11 17:06:18 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/d9c3f934bd0e