Minor optimization, use strdupa() for small alloc ops.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-04-07 10:31:59 +02:00
1 parent 2825100f77
commit d43af8c9c1
3 files changed
+3 -11

No files matched your search

+1 -3
View File
@@ -98,7 +98,7 @@ static void group_init(char *path, int leaf, const char *cfg)
if (!cfg)
return;
s = strdup(cfg);
s = strdupa(cfg);
if (!s) {
_pe("Failed activating cgroup cfg for %s", path);
return;
@@ -115,8 +115,6 @@ static void group_init(char *path, int leaf, const char *cfg)
ptr = strtok(NULL, ",");
}
free(s);
}
static int cgroup_leaf_init(char *group, char *name, int pid, const char *cfg)