diff options
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r-- | usr.bin/tmux/window.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index bcde5f13b9b..443661936b1 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.81 2012/07/08 07:27:32 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.82 2012/07/10 11:53:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -179,9 +179,8 @@ winlink_remove(struct winlinks *wwl, struct winlink *wl) struct window *w = wl->window; RB_REMOVE(winlinks, wwl, wl); - if (wl->status_text != NULL) - xfree(wl->status_text); - xfree(wl); + free(wl->status_text); + free(wl); if (w != NULL) { if (w->references == 0) @@ -359,16 +358,14 @@ window_destroy(struct window *w) window_destroy_panes(w); - if (w->name != NULL) - xfree(w->name); - xfree(w); + free(w->name); + free(w); } void window_set_name(struct window *w, const char *new_name) { - if (w->name != NULL) - xfree(w->name); + free(w->name); w->name = xstrdup(new_name); notify_window_renamed(w); } @@ -671,13 +668,10 @@ window_pane_destroy(struct window_pane *wp) RB_REMOVE(window_pane_tree, &all_window_panes, wp); - if (wp->cwd != NULL) - xfree(wp->cwd); - if (wp->shell != NULL) - xfree(wp->shell); - if (wp->cmd != NULL) - xfree(wp->cmd); - xfree(wp); + free(wp->cwd); + free(wp->shell); + free(wp->cmd); + free(wp); } int @@ -694,18 +688,15 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, close(wp->fd); } if (cmd != NULL) { - if (wp->cmd != NULL) - xfree(wp->cmd); + free(wp->cmd); wp->cmd = xstrdup(cmd); } if (shell != NULL) { - if (wp->shell != NULL) - xfree(wp->shell); + free(wp->shell); wp->shell = xstrdup(shell); } if (cwd != NULL) { - if (wp->cwd != NULL) - xfree(wp->cwd); + free(wp->cwd); wp->cwd = xstrdup(cwd); } @@ -1048,10 +1039,10 @@ window_pane_search(struct window_pane *wp, const char *searchstr, u_int *lineno) *lineno = i; break; } - xfree(line); + free(line); } - xfree(newsearchstr); + free(newsearchstr); return (msg); } |