diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-12-17 00:54:00 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-12-17 09:21:14 +0100 |
commit | eb527ac01ad7e3255b757d620bc678a834a3958a (patch) | |
tree | a6b7eeb10108ec5b23aebbf9e43bf72e74fdefcb /swaynag/swaynag.c | |
parent | Allow tiling views to be dragged by the titlebar (diff) | |
download | sway-eb527ac01ad7e3255b757d620bc678a834a3958a.tar.gz sway-eb527ac01ad7e3255b757d620bc678a834a3958a.tar.zst sway-eb527ac01ad7e3255b757d620bc678a834a3958a.zip |
swaynag: remove double free of details button
If there are no arguments or invalid arguments given, swaynag will free
`swaynag.details.button_details` under the `cleanup` label in main. It
then called `swaynag_destroy`, which would attempt to free it again.
Since `swaynag.details.button_details` is either freed on line 106 of
main (when there is no detailed message) or added to `swaynag.buttons`
on line 103 of main, there is no reason to manually free it in
`swaynag_destroy`.
Although I cannot reproduce a double free on my system, for some reason,
it should have actually resulted in a double free in all code paths.
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r-- | swaynag/swaynag.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index 2fc2416f..674c24b5 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c | |||
@@ -416,7 +416,6 @@ void swaynag_destroy(struct swaynag *swaynag) { | |||
416 | free(button); | 416 | free(button); |
417 | } | 417 | } |
418 | list_free(swaynag->buttons); | 418 | list_free(swaynag->buttons); |
419 | free(swaynag->details.button_details); | ||
420 | free(swaynag->details.message); | 419 | free(swaynag->details.message); |
421 | free(swaynag->details.button_up.text); | 420 | free(swaynag->details.button_up.text); |
422 | free(swaynag->details.button_down.text); | 421 | free(swaynag->details.button_down.text); |