Fixed a memory leak in tComponent

This commit is contained in:
Klaus Schmidinger 2005-05-05 12:41:21 +02:00
parent c8b103c37f
commit fd2c54cec0
3 changed files with 7 additions and 4 deletions

View File

@ -193,6 +193,7 @@ Stefan Huelswitt <huels@iname.com>
for reporting several memory leaks that were introduced through the use of cString
for adding MPEG1 replay capability to cPesAssembler
for fixing handling symbolic links in cRecordings::ScanVideoDir()
for reporting a memory leak in tComponent
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than 27500
@ -1308,3 +1309,6 @@ Ville Skytt
Steffen Beyer <cpunk@reactor.de>
for fixing setting the colored button help after deleting a recording in case the next
menu entry is a directory
Daniel Thompson <daniel.thompson@st.com>
for fixing a memory leak in tComponent

View File

@ -3479,3 +3479,4 @@ Video Disk Recorder Revision History
- Now including the optional user defined Make.config from the 'libsi' Makefile
(thanks to Ville Skyttä).
- Updated the Danish OSD texts (thanks to Mogens Elneff).
- Fixed a memory leak in tComponent (thanks to Stefan Huelswitt and Daniel Thompson).

6
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
* $Id: epg.c 1.27 2005/03/20 12:34:19 kls Exp $
* $Id: epg.c 1.28 2005/05/05 12:37:15 kls Exp $
*/
#include "epg.h"
@ -29,9 +29,7 @@ bool tComponent::FromString(const char *s)
{
unsigned int Stream, Type;
int n = sscanf(s, "%X %02X %3c %a[^\n]", &Stream, &Type, language, &description);
if (n != 4)
description = NULL;
else if (isempty(description)) {
if (n != 4 || isempty(description)) {
free(description);
description = NULL;
}