diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-14 22:32:52 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-20 12:11:32 +0200 |
commit | 5f6e511bdbadead92f243732817f5c65c4f492f4 (patch) | |
tree | 6c438bbf4f8053221866f3e07ffd42dcc0fc74e6 | |
parent | 46716835cfa24374eb47d6e6750571df63f7a602 (diff) | |
download | systemd-5f6e511bdbadead92f243732817f5c65c4f492f4.tar.gz |
test: use pclose() for popen()
Coverity CID#1432701.
(cherry picked from commit 649bde89caccdb1187ac744bd76051fdcd687218)
(cherry picked from commit 0046c5833423ef0ff523b01b130b9cbfc54d58ab)
-rw-r--r-- | src/test/test-env-file.c | 2 | ||||
-rw-r--r-- | src/test/test-fileio.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-env-file.c b/src/test/test-env-file.c index 861238169b..23779b9b87 100644 --- a/src/test/test-env-file.c +++ b/src/test/test-env-file.c @@ -151,7 +151,7 @@ static void test_write_and_load_env_file(void) { _cleanup_(unlink_and_freep) char *p = NULL; _cleanup_strv_free_ char **l = NULL; _cleanup_free_ char *j = NULL, *w = NULL, *cmd = NULL, *from_shell = NULL; - _cleanup_fclose_ FILE *f = NULL; + _cleanup_pclose_ FILE *f = NULL; size_t sz; assert_se(tempfn_random_child(NULL, NULL, &p) >= 0); diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index b342623134..e1d0015e76 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -151,7 +151,7 @@ static void test_parse_env_file(void) { static void test_one_shell_var(const char *file, const char *variable, const char *value) { _cleanup_free_ char *cmd = NULL, *from_shell = NULL; - _cleanup_fclose_ FILE *f = NULL; + _cleanup_pclose_ FILE *f = NULL; size_t sz; assert_se(cmd = strjoin(". ", file, " && /bin/echo -n \"$", variable, "\"")); |