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

Summary: Possible double free in kmsdrm init code on certain errors
Product: SDL Reporter: Simon Hug <chli.hug>
Component: videoAssignee: Brandon Schaefer <brandon.schaefer>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Linux   
Attachments: Patch that fixes the possible double frees in the kmsdrm init code.

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