Remove some unnecessary checks before free().

pull/163/merge
nicm 2015-10-23 16:30:15 +00:00
parent 1a4ddfa8a7
commit 26a55ddcf9
4 changed files with 5 additions and 7 deletions

View File

@ -133,7 +133,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
strerror(errno)); strerror(errno));
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
} else if (cp != NULL) } else
free(cp); free(cp);
cwd = fd; cwd = fd;
} else if (c != NULL && c->session == NULL) } else if (c != NULL && c->session == NULL)

View File

@ -107,7 +107,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
strerror(errno)); strerror(errno));
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
} else if (cp != NULL) } else
free(cp); free(cp);
cwd = fd; cwd = fd;
} else if (cmdq->client != NULL && cmdq->client->session == NULL) } else if (cmdq->client != NULL && cmdq->client->session == NULL)

View File

@ -101,7 +101,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
strerror(errno)); strerror(errno));
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
} else if (cp != NULL) } else
free(cp); free(cp);
cwd = fd; cwd = fd;
} else if (cmdq->client != NULL && cmdq->client->session == NULL) } else if (cmdq->client != NULL && cmdq->client->session == NULL)

2
tty.c
View File

@ -338,9 +338,7 @@ tty_free(struct tty *tty)
tty_close(tty); tty_close(tty);
free(tty->ccolour); free(tty->ccolour);
if (tty->path != NULL)
free(tty->path); free(tty->path);
if (tty->termname != NULL)
free(tty->termname); free(tty->termname);
} }