Opened 13 years ago

Closed 13 years ago

#5004 closed defect (fixed)

remove string leak in VideoOutputDirectfb::GetRefreshRate()

Reported by: Erik Hovland <erik@…> Owned by: danielk
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no


When the env var FRAMEBUFFER can't be found in the environ list the member function then does a strdup("/dev/fb0"). This dynamically allocates a string that will have to be cleaned up later. This is never done, so this little bit of memory is leaked. Since getenv gives up a pointer from environ (that is a static, global list of strings) then it makes sense to just hand over a constant string at this point instead of a strdup of a constant string.

This defect was introduced in changeset:3720 from a patch given to the mythtv-dev list (at least four years ago).

Attachments (1)

libs_libmythtv_videoout_fb.cpp-remove-string-leak.patch (1.2 KB) - added by Erik Hovland <erik@…> 13 years ago.
removes strdup (and also an unneeded null check)

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by Erik Hovland <erik@…>

removes strdup (and also an unneeded null check)

comment:1 Changed 13 years ago by danielk

Milestone: unknown0.22
Owner: changed from Isaac Richards to danielk
Status: newassigned

comment:2 Changed 13 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [17054]) Fixes #5004. Fixes a small memory leak in Linux frame buffer code.

Note: See TracTickets for help on using tickets.