summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-09-09 18:35:06 -0400
committerMatthew Garrett <mjg@redhat.com>2010-09-09 18:35:06 -0400
commit167574f91c2e556849f8de8d74967452a2d2a3a0 (patch)
tree9de7c6126f2616599dd29aac8c6d85ced065742e
parent0a7598932800274bc702742df03f93bb13566f22 (diff)
Avoid memory leak
-rw-r--r--libbacklight.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libbacklight.c b/libbacklight.c
index d3a3342..1579479 100644
--- a/libbacklight.c
+++ b/libbacklight.c
@@ -210,16 +210,15 @@ struct backlight *backlight_init(struct pci_device *dev, int card,
else
goto out;
- free (path);
-
if (connector_type != DRM_MODE_CONNECTOR_LVDS &&
connector_type != DRM_MODE_CONNECTOR_eDP) {
/* External displays are assumed to require
gpu control at the moment */
if (entry_type != BACKLIGHT_RAW)
- continue;
+ goto out;
}
+ free (path);
asprintf(&path, "%s/%s", backlight_path, "device");
ret = readlink(path, buffer, sizeof(buffer));