Commit 95177df3 authored by Nicholas Marriott's avatar Nicholas Marriott
Browse files

Remove some unnecessary checks before free().

parent 7abdaf17
/* $OpenBSD: cmd-new-session.c,v 1.71 2015/09/10 08:58:14 nicm Exp $ */
/* $OpenBSD: cmd-new-session.c,v 1.72 2015/10/23 16:30:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
......@@ -133,7 +133,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
strerror(errno));
return (CMD_RETURN_ERROR);
}
} else if (cp != NULL)
} else
free(cp);
cwd = fd;
} else if (c != NULL && c->session == NULL)
......
/* $OpenBSD: cmd-new-window.c,v 1.46 2015/06/17 16:50:28 nicm Exp $ */
/* $OpenBSD: cmd-new-window.c,v 1.47 2015/10/23 16:30:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
......@@ -107,7 +107,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
strerror(errno));
return (CMD_RETURN_ERROR);
}
} else if (cp != NULL)
} else
free(cp);
cwd = fd;
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
......
/* $OpenBSD: cmd-split-window.c,v 1.57 2015/04/26 20:25:20 nicm Exp $ */
/* $OpenBSD: cmd-split-window.c,v 1.58 2015/10/23 16:30:15 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
......@@ -101,7 +101,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
strerror(errno));
return (CMD_RETURN_ERROR);
}
} else if (cp != NULL)
} else
free(cp);
cwd = fd;
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
......
/* $OpenBSD: tty.c,v 1.189 2015/10/23 15:52:54 nicm Exp $ */
/* $OpenBSD: tty.c,v 1.190 2015/10/23 16:30:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
......@@ -338,10 +338,8 @@ tty_free(struct tty *tty)
tty_close(tty);
free(tty->ccolour);
if (tty->path != NULL)
free(tty->path);
if (tty->termname != NULL)
free(tty->termname);
free(tty->path);
free(tty->termname);
}
void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment