mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
driver/record.cpp: fix fd leak, if record start failed
This commit is contained in:
@@ -171,10 +171,10 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
|||||||
record->Open();
|
record->Open();
|
||||||
|
|
||||||
if(!record->Start(fd, (unsigned short ) allpids.PIDs.vpid, (unsigned short *) apids, numpids, channel_id)) {
|
if(!record->Start(fd, (unsigned short ) allpids.PIDs.vpid, (unsigned short *) apids, numpids, channel_id)) {
|
||||||
/* Stop do close fd */
|
|
||||||
record->Stop();
|
record->Stop();
|
||||||
delete record;
|
delete record;
|
||||||
record = NULL;
|
record = NULL;
|
||||||
|
close(fd);
|
||||||
unlink(tsfile.c_str());
|
unlink(tsfile.c_str());
|
||||||
hintBox.hide();
|
hintBox.hide();
|
||||||
return RECORD_FAILURE;
|
return RECORD_FAILURE;
|
||||||
@@ -215,6 +215,7 @@ bool CRecordInstance::Stop(bool remove_event)
|
|||||||
|
|
||||||
printf("%s: channel %llx recording_id %d\n", __FUNCTION__, channel_id, recording_id);
|
printf("%s: channel %llx recording_id %d\n", __FUNCTION__, channel_id, recording_id);
|
||||||
SaveXml();
|
SaveXml();
|
||||||
|
/* Stop do close fd - if started */
|
||||||
record->Stop();
|
record->Stop();
|
||||||
|
|
||||||
if(!autoshift)
|
if(!autoshift)
|
||||||
|
Reference in New Issue
Block a user