summaryrefslogtreecommitdiffstats
path: root/tmux.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 /tmux.c
parent06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e (diff)
Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/tmux.c b/tmux.c
index 5d8bbb09..5a773f6d 100644
--- a/tmux.c
+++ b/tmux.c
@@ -76,7 +76,7 @@ logfile(const char *name)
if (debug_level > 0) {
xasprintf(&path, "tmux-%s-%ld.log", name, (long) getpid());
log_open(debug_level, path);
- xfree(path);
+ free(path);
}
}
@@ -255,8 +255,7 @@ main(int argc, char **argv)
flags &= ~IDENTIFY_256COLOURS;
break;
case 'c':
- if (shell_cmd != NULL)
- xfree(shell_cmd);
+ free(shell_cmd);
shell_cmd = xstrdup(optarg);
break;
case 'C':
@@ -269,24 +268,21 @@ main(int argc, char **argv)
printf("%s %s\n", __progname, VERSION);
exit(0);
case 'f':
- if (cfg_file != NULL)
- xfree(cfg_file);
+ free(cfg_file);
cfg_file = xstrdup(optarg);
break;
case 'l':
login_shell = 1;
break;
case 'L':
- if (label != NULL)
- xfree(label);
+ free(label);
label = xstrdup(optarg);
break;
case 'q':
quiet = 1;
break;
case 'S':
- if (path != NULL)
- xfree(path);
+ free(path);
path = xstrdup(optarg);
break;
case 'u':
@@ -366,7 +362,7 @@ main(int argc, char **argv)
}
xasprintf(&cfg_file, "%s/%s", home, DEFAULT_CFG);
if (access(cfg_file, R_OK) != 0 && errno == ENOENT) {
- xfree(cfg_file);
+ free(cfg_file);
cfg_file = NULL;
}
}
@@ -393,11 +389,10 @@ main(int argc, char **argv)
}
}
}
- if (label != NULL)
- xfree(label);
+ free(label);
if (realpath(path, socket_path) == NULL)
strlcpy(socket_path, path, sizeof socket_path);
- xfree(path);
+ free(path);
#ifdef HAVE_SETPROCTITLE
/* Set process title. */