From: jusung Date: Fri, 19 Mar 2021 04:28:47 +0000 (+0900) Subject: Fix memory leak X-Git-Tag: accepted/tizen/unified/20210322.150824~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=325690185da46785a30a1b4cb64322d6446ef5cd;p=platform%2Fcore%2Fappfw%2Frpc-port.git Fix memory leak Change-Id: I37ca69f7eb682a4c7a94614b462dff4e410df3f4 Signed-off-by: jusung --- diff --git a/src/rpc-port-parcel.cc b/src/rpc-port-parcel.cc index 2276a77..625bbd9 100644 --- a/src/rpc-port-parcel.cc +++ b/src/rpc-port-parcel.cc @@ -84,8 +84,10 @@ RPC_API int rpc_port_parcel_create_from_port(rpc_port_parcel_h* h, parcel_h parcel = nullptr; int ret = parcel_create(&parcel); - if (ret != PARCEL_ERROR_NONE) + if (ret != PARCEL_ERROR_NONE) { + delete[] buf; return RPC_PORT_ERROR_IO_ERROR; + } parcel_burst_write(parcel, buf, len); delete[] buf;