From e2f60da101de2b626fe030a8dab9b7633d6e33cd Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 25 May 2013 11:58:33 +0100 Subject: [PATCH] Ensure testrec is deleted in TV::HandleStateChange() if the recorder proves to be invalid. Should never have happened in practice. Coverity 1023891 --- mythtv/libs/libmythtv/tv_play.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp index a94aac1653d..36715f0b1ed 100644 --- a/mythtv/libs/libmythtv/tv_play.cpp +++ b/mythtv/libs/libmythtv/tv_play.cpp @@ -2260,6 +2260,8 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx) ctx->SetRecorder(testrec); ctx->recorder->Setup(); } + else + delete testrec; // If testrec isn't a valid recorder ... } else if (getit) chanid = 0;