From 74ca738f6a01fb5fc19c5c3899f5cb1fdc1d7f68 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Sep 2015 15:20:10 +0200 Subject: util: introduce safe_fclose() and port everything over to it Adds a coccinelle script to port things over automatically. --- src/journal/coredump.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/journal/coredump.c') diff --git a/src/journal/coredump.c b/src/journal/coredump.c index 62483a2a05..7d94b145c9 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -512,8 +512,7 @@ static int compose_open_fds(pid_t pid, char **open_fds) { } errno = 0; - fclose(stream); - stream = NULL; + stream = safe_fclose(stream); if (errno != 0) return -errno; -- cgit v1.2.3-54-g00ecf