From f9949593c25ae2d7e71f01f7a9ca80dccd2ef096 Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Wed, 29 Jun 2011 14:44:58 +0200 Subject: Changed a few things according to cppcheck --- extpipe.h | 2 +- maps.cpp | 1 + parse.cpp | 8 ++++---- parse.h | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/extpipe.h b/extpipe.h index 09f9948..8df5356 100644 --- a/extpipe.h +++ b/extpipe.h @@ -12,7 +12,7 @@ private: public: cExtPipe(void); ~cExtPipe(); - operator FILE* () + operator FILE* () const { return f; } diff --git a/maps.cpp b/maps.cpp index 884a23f..8963af5 100644 --- a/maps.cpp +++ b/maps.cpp @@ -74,6 +74,7 @@ cEPGMapping::~cEPGMapping() cEPGMapping::cEPGMapping(cEPGMapping©) { + if (channelname) free((void *) channelname); channelname=strdup(copy.channelname); channelids=NULL; numchannelids=0; diff --git a/parse.cpp b/parse.cpp index 31bb41e..0bb0813 100644 --- a/parse.cpp +++ b/parse.cpp @@ -894,6 +894,9 @@ bool cParse::Process(char *buffer, int bufsize) if (lerr!=PARSE_XMLTVERR) esyslog("xmltv2vdr: '%s' no starttime - error in xmltv file?",name); lerr=PARSE_XMLTVERR; + xmlFree(channelid); + node=node->next; + continue; } if ((starttimeend)) @@ -911,6 +914,7 @@ bool cParse::Process(char *buffer, int bufsize) dsyslog("xmltv2vdr: '%s' till %s",name,ctime(&end)); } oldmap=map; + xmlFree(channelid); xmlChar *vpsstart=xmlGetProp(node,(const xmlChar *) "vps-start"); if (vpsstart) @@ -924,7 +928,6 @@ bool cParse::Process(char *buffer, int bufsize) if (stoptime) xevent.SetDuration(stoptime-starttime); if (!FetchEvent(node)) // sets xevent { - xmlFree(channelid); node=node->next; continue; } @@ -935,7 +938,6 @@ bool cParse::Process(char *buffer, int bufsize) if (lerr!=PARSE_NOSCHEDULES) esyslog("xmltv2vdr: '%s' cannot get schedules",name); lerr=PARSE_NOSCHEDULES; - xmlFree(channelid); node=node->next; continue; } @@ -996,8 +998,6 @@ bool cParse::Process(char *buffer, int bufsize) } } delete schedulesLock; - - xmlFree(channelid); node=node->next; } xmlFreeDoc(xmltv); diff --git a/parse.h b/parse.h index 82db285..08e4500 100644 --- a/parse.h +++ b/parse.h @@ -79,11 +79,11 @@ public: { return vps; } - int Duration() + int Duration() const { return duration; } - time_t StartTime() + time_t StartTime() const { return starttime; } @@ -103,7 +103,7 @@ public: { return country; } - int Year() + int Year() const { return year; } -- cgit v1.2.3