chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Introduce strv_consume which takes ownership
[elogind.git]
/
src
/
core
/
unit.c
diff --git
a/src/core/unit.c
b/src/core/unit.c
index 1c0b0c72ace24ccaa506f2e81a6a6a1f1a660f17..d0e915909af20fb9c7b4cca9140e3ca8210015c6 100644
(file)
--- a/
src/core/unit.c
+++ b/
src/core/unit.c
@@
-3181,11
+3181,9
@@
int unit_require_mounts_for(Unit *u, const char *path) {
return 0;
}
- r = strv_push(&u->requires_mounts_for, p);
- if (r < 0) {
- free(p);
+ r = strv_consume(&u->requires_mounts_for, p);
+ if (r < 0)
return r;
- }
PATH_FOREACH_PREFIX_MORE(prefix, p) {
Set *x;