diff options
author | sh.pi <sh.pi@samsung.com> | 2013-04-22 18:01:46 +0900 |
---|---|---|
committer | sh.pi <sh.pi@samsung.com> | 2013-04-22 18:01:46 +0900 |
commit | 31fc5e18641d49ab4805bc1af2a1dfcc77063e78 (patch) | |
tree | b287e3011a643b8e120722879af8828d9241006e | |
parent | 8ef42ca0d86a4f9001550bf3507c689411d838a2 (diff) | |
download | power-manager-31fc5e18641d49ab4805bc1af2a1dfcc77063e78.tar.gz power-manager-31fc5e18641d49ab4805bc1af2a1dfcc77063e78.tar.bz2 power-manager-31fc5e18641d49ab4805bc1af2a1dfcc77063e78.zip |
Code bugs are fixed.submit/tizen_2.1/20130424.233153accepted/tizen_2.1/20130425.0252152.1b_release
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.c | 5 | ||||
-rw-r--r-- | pm_poll.c | 1 |
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(); } @@ -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; } |