From dc4ebc0787a299f064553e6d28a7f35574ce1c2a Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 17 Aug 2015 09:30:49 +0200 Subject: Bug #944: Deletion of unnecessary checks before calls of the function "free" The function "free" is documented in the way that no action shall occur for a passed null pointer. It is therefore not needed that a function caller repeats a corresponding check. http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first This issue was fixed by using the software Coccinelle 1.0.1. --- src/journal/journal-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/journal') diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index f7815b2796..4f94799ce7 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -169,7 +169,7 @@ void journal_file_close(JournalFile *f) { #ifdef HAVE_GCRYPT if (f->fss_file) munmap(f->fss_file, PAGE_ALIGN(f->fss_file_size)); - else if (f->fsprg_state) + else free(f->fsprg_state); free(f->fsprg_seed); -- cgit v1.2.3-54-g00ecf