mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 00:37:59 +02:00
compositor-drm: Fix memory leak in create_output_for_connector
We do not free the encoder structure on failure. Fix that. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
7551cff986
commit
eb8bed5c73
1 changed files with 4 additions and 1 deletions
|
|
@ -445,12 +445,15 @@ create_output_for_connector(struct drm_compositor *ec,
|
|||
}
|
||||
if (i == resources->count_crtcs) {
|
||||
fprintf(stderr, "No usable crtc for encoder.\n");
|
||||
drmModeFreeEncoder(encoder);
|
||||
return -1;
|
||||
}
|
||||
|
||||
output = malloc(sizeof *output);
|
||||
if (output == NULL)
|
||||
if (output == NULL) {
|
||||
drmModeFreeEncoder(encoder);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(output, 0, sizeof *output);
|
||||
output->base.subpixel = drm_subpixel_to_wayland(connector->subpixel);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue