backlight: fix backlight_path memory leak
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
parent
87d3b61355
commit
981fa33809
@ -210,8 +210,10 @@ struct backlight *backlight_init(struct udev_device *drm_device,
|
||||
entry->d_name) < 0)
|
||||
goto err;
|
||||
|
||||
if (asprintf(&path, "%s/%s", backlight_path, "type") < 0)
|
||||
if (asprintf(&path, "%s/%s", backlight_path, "type") < 0) {
|
||||
free(backlight_path);
|
||||
goto err;
|
||||
}
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user