summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-07-10 11:53:01 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-07-10 11:53:01 +0000
commitdf912e3540968a2a0b266e523ecc08bb2dc0ca20 (patch)
treec2c59d025e08aab048b251d1711ed655cdf115f6 /session.c
parenta3391692ad5800ca034bbbdcd803924fc4e392ee (diff)
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 75ea8b0c..21929d8b 100644
--- a/session.c
+++ b/session.c
@@ -126,8 +126,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);
}
@@ -157,8 +156,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);
@@ -172,7 +170,7 @@ session_destroy(struct session *s)
winlink_remove(&s->windows, wl);
}
- xfree(s->cwd);
+ free(s->cwd);
RB_INSERT(sessions, &dead_sessions, s);
}
@@ -495,7 +493,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);
}
}