mirror of
https://github.com/troglobit/finit.git
synced 2026-10-20 11:19:35 +00:00
Minor optimization, use strdupa() for small alloc ops.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
2825100f77
commit
d43af8c9c1
3 files changed
+3
-11
No files matched your search
+1
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user