backlight: fix backlight_path memory leak
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
87d3b61355
commit
981fa33809
+3
-1
@@ -210,8 +210,10 @@ struct backlight *backlight_init(struct udev_device *drm_device,
|
|||||||
entry->d_name) < 0)
|
entry->d_name) < 0)
|
||||||
goto err;
|
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;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user