From: Hwankyu Jhun Date: Thu, 29 Nov 2018 07:05:02 +0000 (+0900) Subject: Add an exception handling on C Generator X-Git-Tag: accepted/tizen/5.0/unified/20181130.064836~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F194117%2F1;p=platform%2Fcore%2Fappfw%2Ftidl.git Add an exception handling on C Generator Change-Id: I23b5f47df62cc5180f3bd12c7c729d5d840eba20 Signed-off-by: Hwankyu Jhun --- diff --git a/idlc/c_gen/c_proxy_body_gen_cb.h b/idlc/c_gen/c_proxy_body_gen_cb.h index 95a8714..277ad2c 100644 --- a/idlc/c_gen/c_proxy_body_gen_cb.h +++ b/idlc/c_gen/c_proxy_body_gen_cb.h @@ -266,10 +266,15 @@ R"__c_cb( static void __##_on_received(const char *endpoint, const char *port_name, void *data) { rpc_port_proxy_##_h handle = data; - rpc_port_parcel_h parcel_received; + rpc_port_parcel_h parcel_received = NULL; int cmd = -1; rpc_port_parcel_create_from_port(&parcel_received, handle->callback_port); + if (!parcel_received) { + _E("Failed to create parcel from port(%s)", port_name); + return; + } + rpc_port_parcel_read_int32(parcel_received, &cmd); if (cmd != ##_METHOD_Callback) { _E("Invalid protocol");