diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-06-24 07:57:58 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-06-24 07:57:58 +0200 |
commit | 6abdec98f38f457797d666586d117070ccf4e31f (patch) | |
tree | c6188d26e24fd296612e3b377d2eb9db6e9f05c8 /src/import/pull-common.c | |
parent | sd-path: use _cleanup_strv_free_ attribute (diff) | |
download | systemd-6abdec98f38f457797d666586d117070ccf4e31f.tar.xz systemd-6abdec98f38f457797d666586d117070ccf4e31f.zip |
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.c | 8 |
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; } |