Fix memory leak issue 33/113733/3
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 8 Feb 2017 12:47:06 +0000 (21:47 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Thu, 9 Feb 2017 05:52:07 +0000 (14:52 +0900)
Change-Id: I15671f30e12eb93e5fc39188139d4ae5e56aa575
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
lib/buxton2.c
migration/vconf_migration.c

index 486c310..58dba14 100644 (file)
@@ -2064,9 +2064,9 @@ static struct bxt_req *security_control(struct buxton_client *client,
 
        req = create_req(layer, NULL, callback, NULL, user_data);
 
+       layer_unref(layer);
        if (!req)
                return NULL;
-       layer_unref(layer);
 
        memset(&rqst, 0, sizeof(rqst));
        rqst.type = MSG_CTRL;
@@ -2213,9 +2213,9 @@ static struct bxt_req *update_client_label(struct buxton_client *client,
 
        req = create_req(layer, NULL, callback, NULL, user_data);
 
+       layer_unref(layer);
        if (!req)
                return NULL;
-       layer_unref(layer);
 
        memset(&rqst, 0, sizeof(rqst));
        rqst.type = MSG_CTRL;
index 070fba2..3632a78 100644 (file)
@@ -159,12 +159,14 @@ static int _load_vconf_dir(const char *directory)
        struct dirent file_info;
        struct dirent *result;
        char buf[BUF_LEN];
-       keylist_t *keylist = vconf_keylist_new();
+       keylist_t *keylist;
 
        dir = opendir(directory);
        if (!dir)
                return -1;
 
+       keylist = vconf_keylist_new();
+
        while (readdir_r(dir, &file_info, &result) == 0) {
                if (result == NULL)
                        break;