aboutsummaryrefslogtreecommitdiff
path: root/session.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 /session.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 'session.c')
-rw-r--r--session.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/session.c b/session.c
index 13be0c71..1f4fb30c 100644
--- a/session.c
+++ b/session.c
@@ -125,8 +125,7 @@ session_create(const char *name, const char *cmd, const char *cwd,
s->name = NULL;
do {
s->idx = next_session++;
- if (s->name != NULL)
- xfree (s->name);
+ free (s->name);
xasprintf(&s->name, "%u", s->idx);
} while (RB_FIND(sessions, &sessions, s) != NULL);
}
@@ -156,8 +155,7 @@ session_destroy(struct session *s)
RB_REMOVE(sessions, &sessions, s);
notify_session_closed(s);
- if (s->tio != NULL)
- xfree(s->tio);
+ free(s->tio);
session_group_remove(s);
environ_free(&s->environ);
@@ -171,7 +169,7 @@ session_destroy(struct session *s)
winlink_remove(&s->windows, wl);
}
- xfree(s->cwd);
+ free(s->cwd);
RB_INSERT(sessions, &dead_sessions, s);
}
@@ -494,7 +492,7 @@ session_group_remove(struct session *s)
TAILQ_REMOVE(&sg->sessions, TAILQ_FIRST(&sg->sessions), gentry);
if (TAILQ_EMPTY(&sg->sessions)) {
TAILQ_REMOVE(&session_groups, sg, entry);
- xfree(sg);
+ free(sg);
}
}