summaryrefslogtreecommitdiff
path: root/src/import/pull-common.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-06-24 14:57:58 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-24 14:57:58 +0900
commit6abdec98f38f457797d666586d117070ccf4e31f (patch)
treec6188d26e24fd296612e3b377d2eb9db6e9f05c8 /src/import/pull-common.c
parent623550aff7f290a180473cd1a713f1c5ba882d8a (diff)
downloadsystemd-6abdec98f38f457797d666586d117070ccf4e31f.tar.gz
tree-wide: use _cleanup_ attribute and strv_consume() + TAKE_PTR()
Diffstat (limited to 'src/import/pull-common.c')
-rw-r--r--src/import/pull-common.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index 766b97cb0c..62b52309a4 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -61,8 +61,8 @@ int pull_find_old_etags(
}
FOREACH_DIRENT_ALL(de, d, return -errno) {
+ _cleanup_free_ char *u = NULL;
const char *a, *b;
- char *u;
if (de->d_type != DT_UNKNOWN &&
de->d_type != dt)
@@ -97,12 +97,10 @@ int pull_find_old_etags(
if (r < 0)
return r;
- if (!http_etag_is_valid(u)) {
- free(u);
+ if (!http_etag_is_valid(u))
continue;
- }
- r = strv_consume(&l, u);
+ r = strv_consume(&l, TAKE_PTR(u));
if (r < 0)
return r;
}