backlight: fix backlight_path memory leak

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
dev
U. Artie Eoff 11 years ago committed by Kristian Høgsberg
parent 87d3b61355
commit 981fa33809
  1. 4
      src/libbacklight.c

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

Loading…
Cancel
Save