summaryrefslogtreecommitdiffstats
path: root/tmux.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 /tmux.c
parenta3391692ad5800ca034bbbdcd803924fc4e392ee (diff)
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 9a305c02..e01017c9 100644
--- a/tmux.c
+++ b/tmux.c
@@ -73,7 +73,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);
}
}
@@ -252,8 +252,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':
@@ -263,24 +262,21 @@ main(int argc, char **argv)
flags |= IDENTIFY_CONTROL;
break;
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':
@@ -360,7 +356,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;
}
}
@@ -387,11 +383,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);
/* Set process title. */
setproctitle("%s (%s)", __progname, socket_path);