Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13438 closed Bug Report - Memory Leak (fixed)

Potential memory leak in RecorderBase::CheckForRingBufferSwitch

Reported by: David Hampton Owned by: David Hampton
Priority: minor Milestone: 30.1
Component: MythTV - Recording Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

At the end of the RecorderBase::CheckForRingBufferSwitch? function, m_tvrec->RingBufferChanged? is called with recq as an argument, and that function ends up freeing the memory pointed to by recq. Its theoretically possible to get to this point and have m_tvrec be a nullptr, in which case the function isn't called and recq isn't freed. The code needs to delete recq in that case.

Change History (2)

comment:1 Changed 5 years ago by David Hampton <mythtv@…>

Resolution: fixed
Status: assignedclosed

In e6a39281b/mythtv:

tidy: Fix memory leak in HLSSegment::DecodeData?.

The clang-tidy "memory leak" checker pointed out that the
RecorderBase::CheckForRingBufferSwitch? function would leak the memory
pointed to by the 'recq' variable if the 'm_tvrec' variable contains
nullptr. Add a line to free the memory pointed to by the 'recq'
variable in this case.

Fixes #13438.

comment:2 Changed 5 years ago by David Hampton <mythtv@…>

In 3af3cad3d7/mythtv:

tidy: Fix memory leak in HLSSegment::DecodeData?.

The clang-tidy "memory leak" checker pointed out that the
RecorderBase::CheckForRingBufferSwitch? function would leak the memory
pointed to by the 'recq' variable if the 'm_tvrec' variable contains
nullptr. Add a line to free the memory pointed to by the 'recq'
variable in this case.

Fixes #13438.

(cherry picked from commit e6a39281b112fb03ef2f804c13bc6ebe9d336c90)

Note: See TracTickets for help on using tickets.