Code bugs are fixed. 2.1b_release accepted/tizen_2.1/20130425.025215 submit/tizen_2.1/20130424.233153
authorsh.pi <sh.pi@samsung.com>
Mon, 22 Apr 2013 09:01:46 +0000 (18:01 +0900)
committersh.pi <sh.pi@samsung.com>
Mon, 22 Apr 2013 09:01:46 +0000 (18:01 +0900)
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

pm_lsensor.c
pm_poll.c

index 71d6fdf..92c9a49 100644 (file)
@@ -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();
                                }
index 16eadd7..271f866 100644 (file)
--- 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;
                }