From df912e3540968a2a0b266e523ecc08bb2dc0ca20 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 10 Jul 2012 11:53:01 +0000 Subject: xfree is not particularly helpful, remove it. From Thomas Adam. --- window.c | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index cf13c906..cf738a1d 100644 --- a/window.c +++ b/window.c @@ -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); } -- cgit