summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger@gmx.de>2010-06-19 07:46:49 +0200
committerChristian Wieninger <cwieninger@gmx.de>2010-06-19 07:46:49 +0200
commitdef80c75960660aeb58d8dd0611e3a66ed2a9c7c (patch)
treed55655e9d67ad53bf7c6aeae22cef41c67d125b4
parentc7087c922e515ca3a3f52bed3cd97dbb4dcd53d3 (diff)
downloadvdr-plugin-epgsearch-def80c75960660aeb58d8dd0611e3a66ed2a9c7c.tar.gz
vdr-plugin-epgsearch-def80c75960660aeb58d8dd0611e3a66ed2a9c7c.tar.bz2
fixed a memory leak, thanks to Mike Lampard for the hint
-rw-r--r--epgsearchext.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epgsearchext.c b/epgsearchext.c
index f6f75cb..3fd576e 100644
--- a/epgsearchext.c
+++ b/epgsearchext.c
@@ -850,7 +850,6 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven
p1 = Events->First();
time_t tNow=time(NULL);
- char* szTest = NULL;
char* searchText = strdup(search);
int searchStart = 0, searchStop = 0;
@@ -953,6 +952,7 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven
}
}
+ char* szTest = NULL;
msprintf(&szTest, "%s%s%s%s%s", (useTitle?(p->Title()?p->Title():""):""), (useSubtitle||useDescription)?"~":"",
(useSubtitle?(p->ShortText()?p->ShortText():""):""),useDescription?"~":"",
(useDescription?(p->Description()?p->Description():""):""));
@@ -963,11 +963,13 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven
if (szTest && *szTest)
{
if (!MatchesSearchMode(szTest, searchText, mode," ,;|~", fuzzyTolerance))
+ {
+ free(szTest);
continue;
+ }
}
if (szTest)
free(szTest);
- szTest = NULL;
if (useExtEPGInfo && !MatchesExtEPGInfo(p))
continue;