summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsh.pi <sh.pi@samsung.com>2013-04-22 18:01:46 +0900
committersh.pi <sh.pi@samsung.com>2013-04-22 18:01:46 +0900
commit31fc5e18641d49ab4805bc1af2a1dfcc77063e78 (patch)
treeb287e3011a643b8e120722879af8828d9241006e
parent8ef42ca0d86a4f9001550bf3507c689411d838a2 (diff)
downloadpower-manager-31fc5e18641d49ab4805bc1af2a1dfcc77063e78.tar.gz
power-manager-31fc5e18641d49ab4805bc1af2a1dfcc77063e78.tar.bz2
power-manager-31fc5e18641d49ab4805bc1af2a1dfcc77063e78.zip
pm_lsensor.c : unchecked_value: No check of the return value of "device_get_property(DEVICE_TYPE_DISPLAY, cmd, &tmp_value)". pm_poll.c : leaked_storage: Variable "new_path" going out of scope leaks the storage it points to
-rw-r--r--pm_lsensor.c5
-rw-r--r--pm_poll.c1
2 files changed, 4 insertions, 2 deletions
diff --git a/pm_lsensor.c b/pm_lsensor.c
index 71d6fdf..92c9a49 100644
--- a/pm_lsensor.c
+++ b/pm_lsensor.c
@@ -63,10 +63,11 @@ static gboolean alc_handler(gpointer data)
} else {
int tmp_value;
int cmd;
+ int ret;
value = PM_MAX_BRIGHTNESS * (int)light_data.values[0] / 10;
COMBINE_DISP_CMD(cmd, PROP_DISPLAY_BRIGHTNESS, DEFAULT_DISPLAY);
- device_get_property(DEVICE_TYPE_DISPLAY, cmd, &tmp_value);
- if (tmp_value != value) {
+ ret = device_get_property(DEVICE_TYPE_DISPLAY, cmd, &tmp_value);
+ if (!ret && (tmp_value != value)) {
set_default_brt(value);
backlight_restore();
}
diff --git a/pm_poll.c b/pm_poll.c
index 16eadd7..271f866 100644
--- a/pm_poll.c
+++ b/pm_poll.c
@@ -266,6 +266,7 @@ int init_pm_poll(int (*pm_callback) (int, PMMsg *))
adddev = (indev *) malloc(sizeof(indev));
if (!adddev) {
LOGERR("Fail to alloc indev: %s", path_tok);
+ free(new_path);
free(dev_paths);
return -1;
}