mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 17:31:28 +00:00
Merge pull request #2783 from martinetd/swaynag_uaf
swaynag: fix use-after-free in wl_display_dispatch
This commit is contained in:
commit
06fade1c8b
|
@ -390,6 +390,10 @@ void swaynag_run(struct swaynag *swaynag) {
|
||||||
&& wl_display_dispatch(swaynag->display) != -1) {
|
&& wl_display_dispatch(swaynag->display) != -1) {
|
||||||
// This is intentionally left blank
|
// This is intentionally left blank
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (swaynag->display) {
|
||||||
|
wl_display_disconnect(swaynag->display);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void swaynag_destroy(struct swaynag *swaynag) {
|
void swaynag_destroy(struct swaynag *swaynag) {
|
||||||
|
@ -449,8 +453,4 @@ void swaynag_destroy(struct swaynag *swaynag) {
|
||||||
if (swaynag->shm) {
|
if (swaynag->shm) {
|
||||||
wl_shm_destroy(swaynag->shm);
|
wl_shm_destroy(swaynag->shm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swaynag->display) {
|
|
||||||
wl_display_disconnect(swaynag->display);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue