From 9a37a4ca0503d08fed377c3e6714f4059870a7d6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 5 Sep 2024 13:36:24 +0200 Subject: [PATCH] avoid null pointer use --- src/eitd/xmlutil.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index c18666983..b79fb65d4 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -833,8 +833,10 @@ void writeEventsToFile(const char *epgdir) } (*e)->saveXML(eventfile); } - write_epgxml_footer(eventfile); - fclose(eventfile); + if (eventfile != NULL) { + write_epgxml_footer(eventfile); + fclose(eventfile); + } _done: unlockEvents(); write_indexxml_footer(indexfile);