chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a652755
)
cgroup: minor optimization
author
Lennart Poettering
<lennart@poettering.net>
Fri, 22 Mar 2013 05:01:04 +0000
(06:01 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 22 Mar 2013 14:46:49 +0000
(15:46 +0100)
src/core/cgroup.c
patch
|
blob
|
history
diff --git
a/src/core/cgroup.c
b/src/core/cgroup.c
index 4790a09ff24da9ecc2b9da8c09719fcd64500abc..8fb2952c161e26b9d36d1dc041edfbd1a1edeb1c 100644
(file)
--- a/
src/core/cgroup.c
+++ b/
src/core/cgroup.c
@@
-438,7
+438,7
@@
int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bonding)
return 1;
}
- p = strdup(cgroup);
+ p = strdup
a
(cgroup);
if (!p)
return -ENOMEM;
@@
-446,8
+446,7
@@
int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bonding)
char *e;
e = strrchr(p, '/');
- if (!e || e == p) {
- free(p);
+ if (e == p || !e) {
*bonding = NULL;
return 0;
}
@@
-456,7
+455,6
@@
int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bonding)
b = hashmap_get(m->cgroup_bondings, p);
if (b) {
- free(p);
*bonding = b;
return 1;
}