Sync OpenBSD patchset 1150:

xfree is not particularly helpful, remove it. From Thomas Adam.
This commit is contained in:
Tiago Cunha
2012-07-11 19:34:16 +00:00
parent 06d27e94b2
commit a432fcd306
73 changed files with 330 additions and 360 deletions

View File

@ -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);
}