=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- src/usr.bin/tmux/status.c 2012/07/09 09:55:57 1.93 +++ src/usr.bin/tmux/status.c 2012/07/10 11:53:01 1.94 @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.93 2012/07/09 09:55:57 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.94 2012/07/10 11:53:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -222,8 +222,7 @@ /* Calculate the total size needed for the window list. */ wlstart = wloffset = wlwidth = 0; RB_FOREACH(wl, winlinks, &s->windows) { - if (wl->status_text != NULL) - xfree(wl->status_text); + free(wl->status_text); memcpy(&wl->status_cell, &stdgc, sizeof wl->status_cell); wl->status_text = status_print(c, wl, t, &wl->status_cell); wl->status_width = @@ -372,10 +371,8 @@ screen_write_stop(&ctx); out: - if (left != NULL) - xfree(left); - if (right != NULL) - xfree(right); + free(left); + free(right); if (grid_compare(c->status.grid, old_status.grid) == 0) { screen_free(&old_status); @@ -491,8 +488,7 @@ } out: - if (freeptr != NULL) - xfree(freeptr); + free(freeptr); return; skip_to: @@ -572,7 +568,7 @@ cmd[len++] = **iptr; } if (**iptr == '\0') /* no terminating ) */ { - xfree(cmd); + free(cmd); return (NULL); } (*iptr)++; /* skip final ) */ @@ -582,7 +578,7 @@ so_find.cmd = cmd; so = RB_FIND(status_out_tree, &c->status_new, &so_find); if (so != NULL && so->out != NULL) { - xfree(cmd); + free(cmd); return (so->out); } @@ -600,7 +596,7 @@ /* Lookup in the old tree. */ so_find.cmd = cmd; so = RB_FIND(status_out_tree, &c->status_old, &so_find); - xfree(cmd); + free(cmd); if (so != NULL) return (so->out); return (NULL); @@ -618,10 +614,9 @@ so_next = RB_NEXT(status_out_tree, sotree, so); RB_REMOVE(status_out_tree, sotree, so); - if (so->out != NULL) - xfree(so->out); - xfree(so->cmd); - xfree(so); + free(so->out); + free(so->cmd); + free(so); } } @@ -778,7 +773,7 @@ limit = ARRAY_LENGTH(&c->message_log) - limit; for (i = 0; i < limit; i++) { msg = &ARRAY_FIRST(&c->message_log); - xfree(msg->msg); + free(msg->msg); ARRAY_REMOVE(&c->message_log, 0); } } @@ -803,7 +798,7 @@ if (c->message_string == NULL) return; - xfree(c->message_string); + free(c->message_string); c->message_string = NULL; c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE); @@ -912,10 +907,10 @@ if (c->prompt_freefn != NULL && c->prompt_data != NULL) c->prompt_freefn(c->prompt_data); - xfree(c->prompt_string); + free(c->prompt_string); c->prompt_string = NULL; - xfree(c->prompt_buffer); + free(c->prompt_buffer); c->prompt_buffer = NULL; c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE); @@ -928,11 +923,11 @@ void status_prompt_update(struct client *c, const char *msg, const char *input) { - xfree(c->prompt_string); + free(c->prompt_string); c->prompt_string = status_replace(c, NULL, NULL, NULL, msg, time(NULL), 0); - xfree(c->prompt_buffer); + free(c->prompt_buffer); c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input, time(NULL), 0); c->prompt_index = strlen(c->prompt_buffer); @@ -1109,7 +1104,7 @@ memcpy(first, s, strlen(s)); c->prompt_index = (first - c->prompt_buffer) + strlen(s); - xfree(s); + free(s); c->flags |= CLIENT_STATUS; break; @@ -1250,7 +1245,7 @@ histstr = status_prompt_up_history(&c->prompt_hindex); if (histstr == NULL) break; - xfree(c->prompt_buffer); + free(c->prompt_buffer); c->prompt_buffer = xstrdup(histstr); c->prompt_index = strlen(c->prompt_buffer); c->flags |= CLIENT_STATUS; @@ -1259,7 +1254,7 @@ histstr = status_prompt_down_history(&c->prompt_hindex); if (histstr == NULL) break; - xfree(c->prompt_buffer); + free(c->prompt_buffer); c->prompt_buffer = xstrdup(histstr); c->prompt_index = strlen(c->prompt_buffer); c->flags |= CLIENT_STATUS; @@ -1383,7 +1378,7 @@ return; if (size == PROMPT_HISTORY) { - xfree(ARRAY_FIRST(&status_prompt_history)); + free(ARRAY_FIRST(&status_prompt_history)); ARRAY_REMOVE(&status_prompt_history, 0); }