Permalink
Browse files

Fix a memory leak in DVDRingBuffer::GetChapterTimes()

  • Loading branch information...
stuartm committed Apr 17, 2012
1 parent 090f847 commit 7268a9c7c1985ce2542eeab0c16de569b13171b6
Showing with 3 additions and 1 deletion.
  1. +3 −1 mythtv/libs/libmythtv/dvdringbuffer.cpp
@@ -504,7 +504,9 @@ uint64_t DVDRingBuffer::GetChapterTimes(uint title)
for (uint i = 0; i < num - 1; i++)
chapters.append((chaps[i] + 45000) / 90000);
}
- delete chaps;
+ // Assigned via calloc, must be free'd not deleted
+ if (chaps)
+ free(chaps);
m_chapterMap.insert(title, chapters);
return (duration + 45000) / 90000;
}

0 comments on commit 7268a9c

Please sign in to comment.