summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Antonin Décimo <antonin.decimo@gmail.com>2019-08-07 16:04:36 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-08-20 13:27:52 +0900
commit64cfe746ab9a0158d18e7a3d5eedca3d94e80fec (patch)
treee4fc42b776a7dc61704d46ed56b2f2f90b3bc2a8
parentview_update_size: fix surface_width/height mismatch (diff)
downloadsway-64cfe746ab9a0158d18e7a3d5eedca3d94e80fec.tar.gz
sway-64cfe746ab9a0158d18e7a3d5eedca3d94e80fec.tar.zst
sway-64cfe746ab9a0158d18e7a3d5eedca3d94e80fec.zip
Fix memory leaks
-rw-r--r--sway/commands/bar/tray_bind.c1
-rw-r--r--swaybar/tray/icon.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/sway/commands/bar/tray_bind.c b/sway/commands/bar/tray_bind.c
index c910d106..243834ba 100644
--- a/sway/commands/bar/tray_bind.c
+++ b/sway/commands/bar/tray_bind.c
@@ -52,6 +52,7 @@ static struct cmd_results *tray_bind(int argc, char **argv, bool code) {
52 } 52 }
53 } 53 }
54 if (!binding->command) { 54 if (!binding->command) {
55 free(binding);
55 return cmd_results_new(CMD_INVALID, "[Bar %s] Invalid tray command %s", 56 return cmd_results_new(CMD_INVALID, "[Bar %s] Invalid tray command %s",
56 config->current_bar->id, argv[1]); 57 config->current_bar->id, argv[1]);
57 } 58 }
diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c
index c7e7f6bc..429bea36 100644
--- a/swaybar/tray/icon.c
+++ b/swaybar/tray/icon.c
@@ -207,6 +207,7 @@ static struct icon_theme *read_theme_file(char *basedir, char *theme_name) {
207 207
208 struct icon_theme *theme = calloc(1, sizeof(struct icon_theme)); 208 struct icon_theme *theme = calloc(1, sizeof(struct icon_theme));
209 if (!theme) { 209 if (!theme) {
210 fclose(theme_file);
210 return NULL; 211 return NULL;
211 } 212 }
212 theme->subdirs = create_list(); 213 theme->subdirs = create_list();