swaybar: fix double free

status->text should not be freed here. There are two scenarios:

* status->text has been set to an error by status_error. In this case
  the value shouldn't be freed because it's always a reference to a
  constant.
* status->text has been set to status->buffer because the bar is in
  text protocol mode. In this case it's a double free because the
  buffer is already freed after.
master
Mack Straight 6 years ago committed by Brian Ashworth
parent 69e0982439
commit 828060af73

@ -185,7 +185,6 @@ void status_line_free(struct status_line *status) {
} }
free(status->read); free(status->read);
free(status->write); free(status->write);
free((char*) status->text);
free(status->buffer); free(status->buffer);
free(status); free(status);
} }

Loading…
Cancel
Save