projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2796485
)
test: fix memleak in test-fs-util
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Thu, 4 Oct 2018 07:22:11 +0000
(16:22 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Thu, 4 Oct 2018 07:24:44 +0000
(16:24 +0900)
Fixes #10267 and CID#
1395997
.
src/test/test-fs-util.c
patch
|
blob
|
history
diff --git
a/src/test/test-fs-util.c
b/src/test/test-fs-util.c
index a687fd7fa8cd8dc1b18a3035418543b6ecf92f58..d5f652c938395d3c72e7af72e49a9c7c49aa49c0 100644
(file)
--- a/
src/test/test-fs-util.c
+++ b/
src/test/test-fs-util.c
@@
-702,17
+702,17
@@
static void test_rename_noreplace(void) {
}
STRV_FOREACH(b, (char**) table) {
- y = strjoin(z, *b);
- assert_se(y);
+ _cleanup_free_ char *w = NULL;
- if (access(y, F_OK) < 0) {
+ w = strjoin(w, *b);
+ assert_se(w);
+
+ if (access(w, F_OK) < 0) {
assert_se(errno == ENOENT);
continue;
}
- assert_se(rename_noreplace(AT_FDCWD, x, AT_FDCWD, y) == -EEXIST);
-
- y = mfree(y);
+ assert_se(rename_noreplace(AT_FDCWD, w, AT_FDCWD, y) == -EEXIST);
}
y = strjoin(z, "/somethingelse");