summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-15 21:58:22 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-17 00:09:16 -0400
commit543295ad369793bdac510c6c3bf4afae8f1cdab5 (patch)
treeaa04d95ee9e9ef86dc27788d8f5fcbb42082228b /src/core/load-fragment.c
parente8e581bf256b8c0fbd430935af79fa0e8ee570a1 (diff)
core/main: use _cleanup_
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 2a21727c6c..6839da8817 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1314,7 +1314,7 @@ int config_parse_path_spec(const char *unit,
Path *p = data;
PathSpec *s;
PathType b;
- char *k;
+ char _cleanup_free_ *k = NULL;
assert(filename);
assert(lvalue);
@@ -1348,17 +1348,15 @@ int config_parse_path_spec(const char *unit,
if (!path_is_absolute(k)) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
"Path is not absolute, ignoring: %s", k);
- free(k);
return 0;
}
s = new0(PathSpec, 1);
- if (!s) {
- free(k);
+ if (!s)
return log_oom();
- }
s->path = path_kill_slashes(k);
+ k = NULL;
s->type = b;
s->inotify_fd = -1;