Fix issues detected by static analysis tool 06/189306/4
authorjingjin.geng <jingjin.geng@samsung.com>
Mon, 17 Sep 2018 19:18:03 +0000 (03:18 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 17 Sep 2018 09:29:36 +0000 (09:29 +0000)
Change-Id: I1aed65dbd879c2685d40c65eec21f101528575ad

service/src/service.c

index 7d5aeba..b9145b3 100755 (executable)
@@ -250,6 +250,7 @@ static int __message_send(rpc_port_stub_message_context_h context,
                 {
                     PERR("malloc failed");
                 }
+                Py_DECREF(pt_elm_tuple);
             }
             bundle_add_str(reply, "command", "pos_tag");
             bundle_add_str_array(reply, "return_tag", (const char **)tag, len);
@@ -260,7 +261,6 @@ static int __message_send(rpc_port_stub_message_context_h context,
                 free(token[j]);
             }
             Py_DECREF(pt_result);
-            Py_DECREF(pt_elm_tuple);
             PINFO("pos_tag process done");
             break;
         }
@@ -305,6 +305,7 @@ static int __message_send(rpc_port_stub_message_context_h context,
                 {
                     PERR("malloc failed");
                 }
+                Py_DECREF(ne_elm_tuple);
             }
             bundle_add_str(reply, "command", "ne_chunk");
             bundle_add_str_array(reply, "return_tag", (const char **)s_tag, len);
@@ -315,7 +316,6 @@ static int __message_send(rpc_port_stub_message_context_h context,
                 free(s_token[j]);
             }
             Py_DECREF(ne_result);
-            Py_DECREF(ne_elm_tuple);
             PINFO("ne_chunk process done");
             break;
         }