summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/taskset.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util-linux/taskset.c b/util-linux/taskset.c
index abec049..47e9897 100644
--- a/util-linux/taskset.c
+++ b/util-linux/taskset.c
@@ -346,12 +346,13 @@ int taskset_main(int argc UNUSED_PARAM, char **argv)
aff = NULL;
if (opts & OPT_a) {
- char dn[sizeof("/proc/%s/task") + 3 * sizeof(int)];
+ char *dn;
DIR *dir;
struct dirent *ent;
- sprintf(dn, "/proc/%s/task", pid_str);
+ dn = xasprintf("/proc/%s/task", pid_str);
dir = opendir(dn);
+ IF_FEATURE_CLEAN_UP(free(dn);)
if (!dir) {
goto no_threads;
}