mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 00:23:08 +01:00
Remove remaining xfree calls from the portable version.
This commit is contained in:
parent
1f5e6e35d5
commit
513bd8f62d
@ -53,7 +53,7 @@ vasprintf(char **ret, const char *fmt, va_list ap)
|
||||
|
||||
*ret = xmalloc(n + 1);
|
||||
if ((n = vsnprintf(*ret, n + 1, fmt, ap2)) < 0) {
|
||||
xfree(*ret);
|
||||
free(*ret);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ osdep_get_name(int fd, unused char *tty)
|
||||
|
||||
xasprintf(&path, "/proc/%lld/cmdline", (long long) pgrp);
|
||||
if ((f = fopen(path, "r")) == NULL) {
|
||||
xfree(path);
|
||||
free(path);
|
||||
return (NULL);
|
||||
}
|
||||
xfree(path);
|
||||
free(path);
|
||||
|
||||
len = 0;
|
||||
buf = NULL;
|
||||
@ -69,7 +69,7 @@ osdep_get_cwd(pid_t pid)
|
||||
|
||||
xasprintf(&path, "/proc/%d/cwd", pid);
|
||||
n = readlink(path, target, MAXPATHLEN);
|
||||
xfree(path);
|
||||
free(path);
|
||||
if (n > 0) {
|
||||
target[n] = '\0';
|
||||
return (target);
|
||||
|
@ -49,7 +49,7 @@ osdep_get_name(int fd, char *tty)
|
||||
|
||||
xasprintf(&path, "/proc/%u/psinfo", (u_int) pgrp);
|
||||
f = open(path, O_RDONLY);
|
||||
xfree(path);
|
||||
free(path);
|
||||
if (f < 0)
|
||||
return (NULL);
|
||||
|
||||
@ -73,7 +73,7 @@ osdep_get_cwd(pid_t pid)
|
||||
|
||||
xasprintf(&path, "/proc/%u/path/cwd", (u_int) pid);
|
||||
n = readlink(path, target, MAXPATHLEN);
|
||||
xfree(path);
|
||||
free(path);
|
||||
if (n > 0) {
|
||||
target[n] = '\0';
|
||||
return (target);
|
||||
|
Loading…
Reference in New Issue
Block a user