1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a memory leak in the SVDRP command LSTE; fixed a typo in LSTE's help

This commit is contained in:
Klaus Schmidinger 2005-08-07 14:25:31 +02:00
parent 4217d30bff
commit 1921c7465f
3 changed files with 21 additions and 12 deletions

View File

@ -199,6 +199,7 @@ Stefan Huelswitt <huels@iname.com>
for fixing a memory leak in cDvbPlayer for fixing a memory leak in cDvbPlayer
for pointing out that recordings with empty episode names were not listed correctly for pointing out that recordings with empty episode names were not listed correctly
in the LSTR command in the LSTR command
for fixing a memory leak in the SVDRP command LSTE
Ulrich Röder <roeder@efr-net.de> Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than 27500 for pointing out that there are channels that have a symbol rate higher than 27500

View File

@ -3670,3 +3670,4 @@ Video Disk Recorder Revision History
- Fixed cDvbSpuBitmap::putPixel() (thanks to Reinhard Nissl). - Fixed cDvbSpuBitmap::putPixel() (thanks to Reinhard Nissl).
- Fixed setting system time to avoid time jumps in case of faulty data (thanks - Fixed setting system time to avoid time jumps in case of faulty data (thanks
to Andreas Böttger). to Andreas Böttger).
- Fixed a memory leak in the SVDRP command LSTE (thanks to Stefan Huelswitt).

31
svdrp.c
View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.73 2005/07/31 14:31:45 kls Exp $ * $Id: svdrp.c 1.74 2005/08/07 14:20:41 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -209,7 +209,7 @@ const char *HelpPages[] = {
" containing the given string as part of their name are listed.", " containing the given string as part of their name are listed.",
"LSTE [ <channel> ] [ now | next | at <time> ]\n" "LSTE [ <channel> ] [ now | next | at <time> ]\n"
" List EPG data. Without any parameters all data of all channels is\n" " List EPG data. Without any parameters all data of all channels is\n"
" listed. If a channel is given (either by number of by channel ID),\n" " listed. If a channel is given (either by number or by channel ID),\n"
" only data for that channel is listed. 'now', 'next', or 'at <time>'\n" " only data for that channel is listed. 'now', 'next', or 'at <time>'\n"
" restricts the returned data to present events, following events, or\n" " restricts the returned data to present events, following events, or\n"
" events at the given time (which must be in time_t form).", " events at the given time (which must be in time_t form).",
@ -790,18 +790,25 @@ void cSVDRP::CmdLSTE(const char *Option)
p = strtok_r(NULL, delim, &strtok_next); p = strtok_r(NULL, delim, &strtok_next);
} }
} }
FILE *f = fdopen(file, "w"); int fd = dup(file);
if (f) { if (fd) {
if (Schedule) FILE *f = fdopen(fd, "w");
Schedule->Dump(f, "215-", DumpMode, AtTime); if (f) {
else if (Schedule)
Schedules->Dump(f, "215-", DumpMode, AtTime); Schedule->Dump(f, "215-", DumpMode, AtTime);
fflush(f); else
Reply(215, "End of EPG data"); Schedules->Dump(f, "215-", DumpMode, AtTime);
// don't 'fclose(f)' here! fflush(f);
Reply(215, "End of EPG data");
fclose(f);
}
else {
Reply(451, "Can't open file connection");
close(fd);
}
} }
else else
Reply(451, "Can't open file connection"); Reply(451, "Can't dup stream descriptor");
} }
else else
Reply(451, "Can't get EPG data"); Reply(451, "Can't get EPG data");