Skip to content
Commit e342c0fc authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

Fix memory leak with drmModeGetConnectorCurrent()



drmModeGetConnectorCurrent() must provide temporary storage for the
kernel to fill in at least one mode (asking for !=0 modes is how
you prevent the heavyweight probe in the kernel). Currently we malloc
that temp storage but we fail to free it before overwriting the
pointer with the address of the actual storage we use to store the
real mode list we get from the kernel in the second ioctl call.

Let's just keep the temporary storage on the stack and thus we avoid the
leak and also eliminate some pointless mallocs.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Fixes: 5ed5fa10 ("mode: Retrieve only the current information for a Connector")
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 242f77ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment