modify the prevent issue
authorjy910.yun <jy910.yun@samsung.com>
Wed, 17 Apr 2013 11:13:54 +0000 (20:13 +0900)
committerjy910.yun <jy910.yun@samsung.com>
Wed, 17 Apr 2013 11:13:54 +0000 (20:13 +0900)
to avoid resource leak, add free function.
And added return value

ss_bs.c
ss_mmc_handler.c
ss_vibrator.c

diff --git a/ss_bs.c b/ss_bs.c
index d29d1b7..20a2c3e 100644 (file)
--- a/ss_bs.c
+++ b/ss_bs.c
@@ -393,6 +393,7 @@ static int _get_file_count(char *path)
                }
                count++;
        }
+       closedir(dir);
        return count;
 }
 /* check disk available size */
index 5747875..b6b8ea2 100644 (file)
@@ -627,8 +627,8 @@ static int __mmc_mount_fs(void)
        if (fd < 0) {
                PRT_TRACE_ERR("can't open the '%s': %s", buf, strerror(errno));
                snprintf(buf, sizeof(buf), "%s%d", MMC_DEV, blk_num);
-       }
-       close(fd);
+       } else
+               close(fd);
 
        switch (inserted_type) {
        case FS_TYPE_FAT:
index b97a74b..7e42faa 100644 (file)
@@ -46,11 +46,13 @@ static GList *haptic_head;
 static int add_node(struct haptic_node *node)
 {
        haptic_head = g_list_append(haptic_head, node);
+       return 0;
 }
 
 static int delete_node(struct haptic_node *node)
 {
        haptic_head = g_list_remove(haptic_head, node);
+       return 0;
 }
 
 static struct haptic_node *find_node(int handle)