Opened 10 years ago
Closed 10 years ago
Last modified 10 years ago
#12131 closed Patch - Bug Fix (fixed)
Memory leak in LoggingItem::setThreadName()
Reported by: | Owned by: | JYA | |
---|---|---|---|
Priority: | minor | Milestone: | 0.27.2 |
Component: | MythTV - General | Version: | 0.27-fixes |
Severity: | medium | Keywords: | |
Cc: | Stuart Auchterlonie | Ticket locked: | no |
Description
This inline method is called thousands of times, mostly via MPoolThread::run's calls to loggingRegisterThread, so the old value of m_threadName needs to be freed before a new value is set.
Attachments (1)
Change History (9)
Changed 10 years ago by
Attachment: | logging.patch added |
---|
comment:2 Changed 10 years ago by
This setter is the only one that popped up in the valgrind run that prompted me to test and then offer this patch, but that doesn't mean similar changes shouldn't be made to the other setters. I was also wondering if the project has any rules of thumb regarding the size and frequency of use of inline methods. IOW, should this setter (and maybe others) be moved to logging.cpp?
comment:3 Changed 10 years ago by
Cc: | Stuart Auchterlonie added |
---|
Replying to dekarl:
After a quick look at the patch and file I'm wondering if the various setters that use strdup shouldn't all be doing the same.
Yes i think they should!
comment:4 Changed 10 years ago by
Owner: | set to JYA |
---|---|
Status: | new → accepted |
comment:5 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:8 Changed 10 years ago by
Milestone: | unknown → 0.27.2 |
---|
After a quick look at the patch and file I'm wondering if the various setters that use strdup shouldn't all be doing the same.