mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 10:10:41 +00:00
gpu_display: fix dangling NULL pointer in dwl_context_setup
If the dwl_context_setup routine fails after creating a wayland connection succesfully (e.g. if an extension is missing), the fail label is jumped to in order to disconnect the wayland connection and deallocate the wl_display structure. That label did not set self->display to NULL after calling wl_display_disconnect, which would cause the dwl_context_destroy routine to call wl_display_disconnect again, which is a double free. This CL fixes that ommission. TEST=None BUG=None Change-Id: I5b6c2d6fadda82dff4130bd4abb0e7764c15e004 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1668528 Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Zach Reizner <zachr@chromium.org>
This commit is contained in:
parent
4aaefc377f
commit
f51787b1c7
1 changed files with 1 additions and 0 deletions
|
@ -425,6 +425,7 @@ bool dwl_context_setup(struct dwl_context *self, const char *socket_path)
|
|||
|
||||
fail:
|
||||
wl_display_disconnect(display);
|
||||
self->display = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue