aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2012-07-11 19:34:16 +0000
committerTiago Cunha <tcunha@gmx.com>2012-07-11 19:34:16 +0000
commita432fcd30617610b46d65f49b7513bf5da5694de (patch)
treeb76ab1cefbd5a0020fa789b2c925f31ef9d5796b /window.c
parent06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e (diff)
downloadrtmux-a432fcd30617610b46d65f49b7513bf5da5694de.tar.gz
rtmux-a432fcd30617610b46d65f49b7513bf5da5694de.tar.bz2
rtmux-a432fcd30617610b46d65f49b7513bf5da5694de.zip
Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
Diffstat (limited to 'window.c')
-rw-r--r--window.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/window.c b/window.c
index 3140a025..a832f4f3 100644
--- a/window.c
+++ b/window.c
@@ -176,9 +176,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)
@@ -356,16 +355,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);
}
@@ -668,13 +665,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
@@ -691,18 +685,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);
}
@@ -1058,10 +1049,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);
}