aboutsummaryrefslogtreecommitdiff
path: root/server-client.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 /server-client.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 'server-client.c')
-rw-r--r--server-client.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/server-client.c b/server-client.c
index a85561c3..e2a5b957 100644
--- a/server-client.c
+++ b/server-client.c
@@ -20,6 +20,7 @@
#include <event.h>
#include <fcntl.h>
+#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
@@ -150,31 +151,25 @@ server_client_lost(struct client *c)
status_free_jobs(&c->status_old);
screen_free(&c->status);
- if (c->title != NULL)
- xfree(c->title);
+ free(c->title);
evtimer_del(&c->repeat_timer);
if (event_initialized(&c->identify_timer))
evtimer_del(&c->identify_timer);
- if (c->message_string != NULL)
- xfree(c->message_string);
+ free(c->message_string);
if (event_initialized (&c->message_timer))
evtimer_del(&c->message_timer);
for (i = 0; i < ARRAY_LENGTH(&c->message_log); i++) {
msg = &ARRAY_ITEM(&c->message_log, i);
- xfree(msg->msg);
+ free(msg->msg);
}
ARRAY_FREE(&c->message_log);
- if (c->prompt_string != NULL)
- xfree(c->prompt_string);
- if (c->prompt_buffer != NULL)
- xfree(c->prompt_buffer);
-
- if (c->cwd != NULL)
- xfree(c->cwd);
+ free(c->prompt_string);
+ free(c->prompt_buffer);
+ free(c->cwd);
environ_free(&c->environ);
@@ -661,12 +656,11 @@ server_client_set_title(struct client *c)
title = status_replace(c, NULL, NULL, NULL, template, time(NULL), 1);
if (c->title == NULL || strcmp(title, c->title) != 0) {
- if (c->title != NULL)
- xfree(c->title);
+ free(c->title);
c->title = xstrdup(title);
tty_set_title(&c->tty, c->title);
}
- xfree(title);
+ free(title);
}
/* Dispatch message from client. */