diff options
author | 2018-10-07 09:57:51 +0200 | |
---|---|---|
committer | 2018-10-07 09:57:51 +0200 | |
commit | 06fade1c8beab328566090fd08afc7bd9d4d98a3 (patch) | |
tree | 02a3529687a10f75d84bcc60fed35a667aaad02c /swaynag/swaynag.c | |
parent | Merge pull request #2778 from emersion/swaybar-seat-pointer (diff) | |
parent | swaynag: fix use-after-free in wl_display_dispatch (diff) | |
download | sway-06fade1c8beab328566090fd08afc7bd9d4d98a3.tar.gz sway-06fade1c8beab328566090fd08afc7bd9d4d98a3.tar.zst sway-06fade1c8beab328566090fd08afc7bd9d4d98a3.zip |
Merge pull request #2783 from martinetd/swaynag_uaf
swaynag: fix use-after-free in wl_display_dispatch
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r-- | swaynag/swaynag.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index 26d3589e..69da851e 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c | |||
@@ -390,6 +390,10 @@ void swaynag_run(struct swaynag *swaynag) { | |||
390 | && wl_display_dispatch(swaynag->display) != -1) { | 390 | && wl_display_dispatch(swaynag->display) != -1) { |
391 | // This is intentionally left blank | 391 | // This is intentionally left blank |
392 | } | 392 | } |
393 | |||
394 | if (swaynag->display) { | ||
395 | wl_display_disconnect(swaynag->display); | ||
396 | } | ||
393 | } | 397 | } |
394 | 398 | ||
395 | void swaynag_destroy(struct swaynag *swaynag) { | 399 | void swaynag_destroy(struct swaynag *swaynag) { |
@@ -449,8 +453,4 @@ void swaynag_destroy(struct swaynag *swaynag) { | |||
449 | if (swaynag->shm) { | 453 | if (swaynag->shm) { |
450 | wl_shm_destroy(swaynag->shm); | 454 | wl_shm_destroy(swaynag->shm); |
451 | } | 455 | } |
452 | |||
453 | if (swaynag->display) { | ||
454 | wl_display_disconnect(swaynag->display); | ||
455 | } | ||
456 | } | 456 | } |