Commit 9945b4ae authored by Tom Denis's avatar Tom Denis Committed by Michel Dänzer
Browse files

Avoid use-after-free in drmmode_output_destroy()



The encoders array is freed before potentially all of the elements of
the array are individually freed.
Signed-off-by: Tom Denis's avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König's avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> (cosmetic fixups)
parent 36b3faeb
......@@ -1077,8 +1077,8 @@ static void drmmode_output_destroy(xf86OutputPtr output)
}
for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) {
drmModeFreeEncoder(drmmode_output->mode_encoders[i]);
free(drmmode_output->mode_encoders);
}
free(drmmode_output->mode_encoders);
free(drmmode_output->props);
drmModeFreeConnector(drmmode_output->mode_output);
free(drmmode_output);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment