In VideoOutputDirectfb::GetRefreshRate() there is a call to getenv. If
From: Erik Hovland <erik@hovland.org>
that returns null the conditional will do a strdup of a constant
string and use that to open up the frame buffer device instead.
That strdup is an allocation and it will leak a string since it is
not freed later.
getenv doesn't leak because it sets the string pointer to the
location of the string in the environ string list. That is a
static global that the process.
---
libs/libmythtv/videoout_directfb.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/libmythtv/videoout_directfb.cpp b/libs/libmythtv/videoout_directfb.cpp
index c681d4b..1f06dda 100644
a
|
b
|
int VideoOutputDirectfb::GetRefreshRate(void) |
306 | 306 | long htotal; |
307 | 307 | long vtotal; |
308 | 308 | char *fb_dev_name = NULL; |
309 | | if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) |
310 | | fb_dev_name = strdup("/dev/fb0"); |
| 309 | if (!(fb_dev_name = getenv("FRAMEBUFFER"))) |
| 310 | fb_dev_name = "/dev/fb0"; |
311 | 311 | |
312 | 312 | fh = open(fb_dev_name, O_RDONLY); |
313 | 313 | if (-1 == fh) { |