mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 15:36:29 +01:00
Fix potential NULL reference on cleanup
If allocation of bindings failed. Found with clang-tidy
This commit is contained in:
parent
a6307aed00
commit
30fa7d191e
1 changed files with 4 additions and 2 deletions
|
@ -39,8 +39,10 @@ void free_bar_config(struct bar_config *bar) {
|
|||
free(bar->swaybar_command);
|
||||
free(bar->font);
|
||||
free(bar->separator_symbol);
|
||||
for (int i = 0; i < bar->bindings->length; i++) {
|
||||
free_bar_binding(bar->bindings->items[i]);
|
||||
if (bar->bindings) {
|
||||
for (int i = 0; i < bar->bindings->length; i++) {
|
||||
free_bar_binding(bar->bindings->items[i]);
|
||||
}
|
||||
}
|
||||
list_free(bar->bindings);
|
||||
list_free_items_and_destroy(bar->outputs);
|
||||
|
|
Loading…
Reference in a new issue