backlight: fix backlight_path memory leak

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
U. Artie Eoff 2014-01-15 08:12:19 -08:00 committed by Kristian Høgsberg
parent 87d3b61355
commit 981fa33809

View File

@ -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);