fix memory leak issue 25/115425/1
authorKyeonghun Lee <kh9090.lee@samsung.com>
Mon, 20 Feb 2017 02:01:29 +0000 (11:01 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Mon, 20 Feb 2017 02:04:21 +0000 (18:04 -0800)
Change-Id: I7bd8ade3555eac270d2c63d69a3f70e7493ce787
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
utils/MsgJsonParser.cpp

index 6fce3d8..96cfebe 100755 (executable)
@@ -45,7 +45,7 @@ msg_json_gen_object* msg_json_gen_new_obj(msg_json_gen_type type)
 
                if (new_obj == NULL) {
                        if (type == MSG_JSON_GEN_OBJECT)
-                               json_object_ref((JsonObject *)json_value);
+                               json_object_unref((JsonObject *)json_value);
                        else if (type == MSG_JSON_GEN_ARRAY)
                                json_array_unref((JsonArray *)json_value);
 
@@ -66,7 +66,7 @@ void msg_json_gen_free_obj(msg_json_gen_object *obj)
        }
        if (obj->value != NULL) {
                if (obj->type == MSG_JSON_GEN_OBJECT)
-                       json_object_ref((JsonObject *)obj->value);
+                       json_object_unref((JsonObject *)obj->value);
                else if (obj->type == MSG_JSON_GEN_ARRAY)
                        json_array_unref((JsonArray *)obj->value);